I looked at the site and it talked about something I had already tried which works well. Here is another patch hope its better.
Signed-off-by: Jonathan Mzengeza jtmze87@gmail.com Index: vis.c =================================================================== --- vis.c (revision 1343) +++ vis.c (working copy) @@ -566,6 +566,7 @@ buffer_t *last_send = NULL; size_t ret; char* send_buffer = NULL; + char tmp[4096];
while ( !is_aborted() ) {
@@ -600,6 +601,17 @@
}
+ shutdown(thread_data->socket, SHUT_WR); + + for(;;) { + ret=read(thread_data->socket, tmp, sizeof(tmp)); + if(ret < 0) { + break; + } + if(!ret) { + break; + } + } if ( debug_level > 0 ) debug_output( "TCP client has left: %s \n", thread_data->ip );