Keeping debug info, this version doesn't close the accepted listening socket at the end of message send.
This commit is contained in:
parent
388605ffe1
commit
89ae5eee5e
1 changed files with 2 additions and 2 deletions
|
|
@ -91,7 +91,7 @@ int main(int argc, char **argv)
|
|||
printf("\nConnection received.\n");
|
||||
}
|
||||
// grab the data from the client, save to message.
|
||||
messageBytes = recv(clientEchoFD, message, BUFFER_SIZE, MSG_WAITALL);
|
||||
messageBytes = recv(clientEchoFD, message, BUFFER_SIZE, 0);
|
||||
// if "01189998811991197253\r\n" is received, then close the server.
|
||||
if (strcmp(message, "01189998811991197253\n") == 0 || strcmp(message, "01189998811991197253\r\n") == 0)
|
||||
{
|
||||
|
|
@ -115,7 +115,7 @@ int main(int argc, char **argv)
|
|||
printf("\nMESSAGE SENT\n");
|
||||
}
|
||||
// close the accepted listening socket since it is no longer needed.
|
||||
close(clientEchoFD);
|
||||
// close(clientEchoFD);
|
||||
}
|
||||
// close the socket
|
||||
close(socketEchoFD);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue