close socket when done

This commit is contained in:
Eric House 2011-11-17 19:56:54 -08:00
parent 8a51d5f3e4
commit cd699ba547

View file

@ -265,6 +265,7 @@ send_msg( const unsigned char* buf, int len )
assert( nwritten == sizeof(hdr) ); assert( nwritten == sizeof(hdr) );
nwritten = write( sock, buf, len ); nwritten = write( sock, buf, len );
assert( nwritten == len ); assert( nwritten == len );
close( sock );
} }
static void static void
@ -340,8 +341,6 @@ do_fetch( int sockfd, const char** connNames, int nConnNames,
if ( bufp + len > end ) { if ( bufp + len > end ) {
break; break;
} }
fprintf( stderr, "%s: writing %d bytes to fd %d\n", __func__,
len, fd );
nwritten = write( fd, bufp, len ); nwritten = write( fd, bufp, len );
assert( nwritten == len ); assert( nwritten == len );
bufp += len; bufp += len;