While i was doing a project for a networking class of mine i was asked to create a UDP server what would emulate a number guessing game between the client and the server. The client will send its guess to the server and it will determine if it is correct and respond accordingly.
To set up a server you must fist initialize, create, and bind the socket that you will use to pass information. I thought that the binding would also take place in the client but i does it not. As a result of my mistake i would receive the data that i gave the server instead of the correct response. For example when i would concatenate my message and send it to my server my input and output would end up looking some like this GET /NumberGuessing/n=2.
After careful study i noticed that i shouldn't have had the bind on the client side and after that the server started to respond to the messages i would send it.