From ae5263234c9f36a62a7b94f68b43a5398b91948d Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 15 Jul 2005 21:30:13 +0000 Subject: [PATCH] added shutdown call before closing socket git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@401 9efc2488-bf62-4759-914b-345cdb29e865 --- src/utils/socket_bundle.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/socket_bundle.c b/src/utils/socket_bundle.c index 1a5497f..639f738 100644 --- a/src/utils/socket_bundle.c +++ b/src/utils/socket_bundle.c @@ -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" ); -- 2.11.0