Reverted the close connection, improve debug messages.
This commit is contained in:
parent
89ae5eee5e
commit
439d6b1bf7
1 changed files with 3 additions and 3 deletions
|
|
@ -88,7 +88,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("\nConnection received.\n");
|
printf("\nConnection received from client.\n");
|
||||||
}
|
}
|
||||||
// grab the data from the client, save to message.
|
// grab the data from the client, save to message.
|
||||||
messageBytes = recv(clientEchoFD, message, BUFFER_SIZE, 0);
|
messageBytes = recv(clientEchoFD, message, BUFFER_SIZE, 0);
|
||||||
|
|
@ -112,10 +112,10 @@ int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
// send back the message over the clientEcho socket.
|
// send back the message over the clientEcho socket.
|
||||||
send(clientEchoFD, message, sizeof(message), 0);
|
send(clientEchoFD, message, sizeof(message), 0);
|
||||||
printf("\nMESSAGE SENT\n");
|
printf("\nMessage has been sent back to client.\n");
|
||||||
}
|
}
|
||||||
// close the accepted listening socket since it is no longer needed.
|
// close the accepted listening socket since it is no longer needed.
|
||||||
// close(clientEchoFD);
|
close(clientEchoFD);
|
||||||
}
|
}
|
||||||
// close the socket
|
// close the socket
|
||||||
close(socketEchoFD);
|
close(socketEchoFD);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue