Connecting Tech Pros Worldwide Forums | Help | Site Map

Another winsock error. (c++)

Member
 
Join Date: Aug 2008
Location: South essex, England
Posts: 82
#1: Aug 31 '08
Hi, my client is having problems recieving server messages.
But the client recieves the messages restricted to the lenth of the first recieved message.
In order, the server sends, "Welcome", "-Ping", and "-RequestName".
Expand|Select|Wrap|Line Numbers
  1. char buf[1000];
  2. for(;;){
  3.                     recv(mysoc, buf, 1000, 0);
  4.                     std:: cout << "Server: "<< buf << ".\n";
  5. ...
  6. }
Heres the client output:

Server: Welcome
Server: -Pingme.
Server: -Requme.

Do I need to empty buf? if so, how?

Member
 
Join Date: Aug 2008
Location: South essex, England
Posts: 82
#2: Aug 31 '08

re: Another winsock error. (c++)


Damn, it was server:
send(client[id].clientsocket, "-RequestName", 5, 0);

Please lock/delete.
Closed Thread