Hi,
I've been having trouble recently with sending messages to a client.
The client seems to be recieving the sever output (in the console).
This has completely done me in.
I have noticed it is to do with the buffer size.
For example:
-
send(client[i].clientsocket, "-h7-Endlist" , sizeof("-h7-Endlist"), 0); // is the previous send() call
-
send(client[i].clientsocket, client[id].clientname, sizeof(client[id].clientname), 0);
-
send(client[i].clientsocket, " signed in.\n" , sizeof(" signed in.\n") , 0);
Would send ' signed in.'.
And when I do somthing like this:
-
send(client[i].clientsocket, "-h7-Endlist" , sizeof("-h7-Endlist "), 0); // is the previous send() call
-
send(client[i].clientsocket, " Says:\n" , 1000, 0);
-
send(client[i].clientsocket, client[id].buf , 1000, 0);
-
Would show something liek:
'beta 6
Adam signed in.'
Where 'beta 6' is displayed in the server console, and strangely gets put into send() function.
Also, this worked perfectly over a LAN connect, but not over a WAN connection.
All required ports are opend and forwarded properly.
Is this my cheesy scripting? or a fixable common error?