From b94a6a42c1024c00fab7b678cccaecfaa7604d56 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 21 Jan 2009 03:51:50 +0000 Subject: david - needed to actually import the shutdown function from the winsock dll.. --- src/linux_compatibility.h | 1 + src/socket.cpp | 2 +- src/win32_compatibility.cpp | 5 +++++ src/win32_compatibility.h | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/linux_compatibility.h b/src/linux_compatibility.h index 6d3d85e..5d2df1b 100644 --- a/src/linux_compatibility.h +++ b/src/linux_compatibility.h @@ -4,6 +4,7 @@ #define bu_inet_addr inet_addr #define bu_select select #define bu_socket socket +#define bu_shutdown shutdown #define bu_htons htons #define bu_htonl htonl #define bu_gethostbyname gethostbyname diff --git a/src/socket.cpp b/src/socket.cpp index 8937fd1..a660b30 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -136,7 +136,7 @@ void Bu::Socket::close() #define SHUT_RDWR (SD_BOTH) #endif #endif - shutdown( nSocket, SHUT_RDWR ); + bu_shutdown( nSocket, SHUT_RDWR ); ::close( nSocket ); } bActive = false; diff --git a/src/win32_compatibility.cpp b/src/win32_compatibility.cpp index b85e869..c052e0b 100644 --- a/src/win32_compatibility.cpp +++ b/src/win32_compatibility.cpp @@ -14,6 +14,7 @@ deffunc( inet_ntoa ); deffunc( inet_addr ); deffunc( select ); deffunc( socket ); +deffunc( shutdown ); deffunc( ioctlsocket ); deffunc( htons ); deffunc( htonl ); @@ -49,6 +50,7 @@ Bu::Winsock2::Winsock2() getfunc( inet_addr ); getfunc( select ); getfunc( socket ); + getfunc( shutdown ); getfunc( ioctlsocket ); getfunc( htons ); getfunc( htonl ); @@ -102,6 +104,9 @@ int Bu::Winsock2::select( int a, fd_set *b, fd_set *c, fd_set *d, SOCKET Bu::Winsock2::socket( int domain, int type, int protocol ) { return (*Bu::Winsock2::_fnptr_socket)( domain, type, protocol ); } +int Bu::Winsock2::shutdown( SOCKET s, int how ) { + return (*Bu::Winsock2::_fnptr_shutdown)( s, how ); +} int Bu::Winsock2::ioctlsocket( SOCKET s, long cmd, u_long *argp ) { return (*Bu::Winsock2::_fnptr_ioctlsocket)( s, cmd, argp ); } diff --git a/src/win32_compatibility.h b/src/win32_compatibility.h index 36613d1..2cce888 100644 --- a/src/win32_compatibility.h +++ b/src/win32_compatibility.h @@ -63,6 +63,7 @@ namespace Bu decltype( int, select, int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timeval *timeout ); decltype( SOCKET, socket, int domain, int type, int protocol ); + decltype( int, shutdown, SOCKET s, int how ); decltype( int, ioctlsocket, SOCKET s, long cmd, u_long *argp ); decltype( u_short, htons, u_short in ); decltype( u_long, htonl, u_long in ); @@ -101,6 +102,7 @@ namespace Bu #define bu_inet_addr (*Bu::Winsock2::inet_addr) #define bu_select (*Bu::Winsock2::select) #define bu_socket (*Bu::Winsock2::socket) +#define bu_shutdown (*Bu::Winsock2::shutdown) #define bu_ioctlsocket (*Bu::Winsock2::ioctlsocket) #define bu_htons (*Bu::Winsock2::htons) #define bu_htonl (*Bu::Winsock2::htonl) -- cgit v1.2.3