diff --git a/echoserver/echoserver.c b/echoserver/echoserver.c index d3e59f9..80e41e0 100644 --- a/echoserver/echoserver.c +++ b/echoserver/echoserver.c @@ -123,7 +123,7 @@ int main(int argc, char **argv) // grab the data from the client, save to message. messageBytes = recv(fileIter, message, BUFFER_SIZE, 0); // make sure that the connection is still open before attempting to send. - if(messageBytes <= 0) + if(messageBytes == 0) // old: messageBytes <= 0 { printf("\nmessageBytes: %d\n", messageBytes); // if it is not open, close the socket and remove the socket from the socket list using FD_CLR()