Basically, I write a simple program using the boost socket library ... I have two programs - a client and a server. the server expects a connection from the client, and when it finds it, the client sends a message to the server, and the server prints it, this works when the client first requests it, but after a while a strange template starts saying that our server was there and I used the client program twice, by doing:
./client localhost name message
./client localhost name test
0f output will be the server first:
name: message
but then it will be displayed
name: testage
I donβt know why this is happening, but I know that it should be a server, because each client sends a packet regardless of whether the server just prints it ... I think this has something to do with the socket buffer is not reset or something like that...
anyway heres source code: client.cpp
http://pastebin.com/hWpLNqnW
server.cpp
http://pastebin.com/Q4esYwdc
user451498
source share