diff options
Diffstat (limited to '')
-rw-r--r-- | src/serversocket.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/serversocket.cpp b/src/serversocket.cpp index 1424630..010c562 100644 --- a/src/serversocket.cpp +++ b/src/serversocket.cpp | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <fcntl.h> | 13 | #include <fcntl.h> |
14 | #include "serversocket.h" | 14 | #include "serversocket.h" |
15 | #include "exceptions.h" | 15 | #include "exceptions.h" |
16 | #include "osx_compatibility.h" | ||
16 | 17 | ||
17 | Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) : | 18 | Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) : |
18 | nPort( nPort ) | 19 | nPort( nPort ) |
@@ -117,9 +118,13 @@ int Bu::ServerSocket::accept( int nTimeoutSec, int nTimeoutUSec ) | |||
117 | nClient = ::accept( nServer, (struct sockaddr *)&clientname, | 118 | nClient = ::accept( nServer, (struct sockaddr *)&clientname, |
118 | (int *)&size | 119 | (int *)&size |
119 | ); | 120 | ); |
120 | #else | 121 | #else /* not-cygwin */ |
121 | nClient = ::accept( nServer, (struct sockaddr *)&clientname, &size ); | 122 | #ifdef __APPLE__ |
122 | #endif | 123 | nClient = ::accept( nServer, (struct sockaddr *)&clientname, (socklen_t*)&size ); |
124 | #else /* linux */ | ||
125 | nClient = ::accept( nServer, (struct sockaddr *)&clientname, &size ); | ||
126 | #endif /* __APPLE__ */ | ||
127 | #endif /* __CYGWIN__ */ | ||
123 | if( nClient < 0 ) | 128 | if( nClient < 0 ) |
124 | { | 129 | { |
125 | throw SocketException( | 130 | throw SocketException( |