|
-
December 7th, 2009, 02:43 PM
#1
Timestamp echo message
Hey,
I know this may not be enough info but i am trying to accept messages sent by the client, so i am working on the server code to accept requests.
Now, i am trying to do a timestamp echo message as i am not really that good with C++. I am trying to work with somebody elses work :-(
Here is my code:-
if (command_str == "TIM")
{
string msg_sz = receive(connSocket, 4);
int size = atoi(msg_sz.c_str());
string msg = receive(connSocket, size);
response = "TIMRP"+msg_sz+msg;
}
TIM and TIMRP are the protocols that i am following, it all works on the client side, but i need the server to accept. What is happening is that i am typing in "Test", i want the client to display the word "Test" and the time it has been received.
Is there something wrong with the code i have?
When i run the code i get an internet abort error?
Apologies if i have been vague..
Regards
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|