added shutdown call before closing socket
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 15 Jul 2005 21:30:13 +0000 (21:30 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 15 Jul 2005 21:30:13 +0000 (21:30 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@401 9efc2488-bf62-4759-914b-345cdb29e865

src/utils/socket_bundle.c

index 1a5497f..639f738 100644 (file)
@@ -223,6 +223,10 @@ int socket_send(int sock_fd, const char* data) {
 void socket_disconnect(socket_manager* mgr, int sock_fd) {
 
        debug_handler("Closing socket %d", sock_fd);
+
+       if( shutdown( sock_fd, SHUT_RDWR ) )
+               warning_handler( "socket_disconnect(): Error shuting down socket, removing anyway" );
+
        if( close( sock_fd ) == -1 ) 
                warning_handler( "socket_disconnect(): Error closing socket, removing anyway" );