From e94c3e5e551271ebdb98f444850de873dc4837f0 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 22 Apr 2007 20:48:18 +0000 Subject: Ignore attempts to listen on a Unix socket on Win32, so that we can share config files for the unit tests (refs #3) --- lib/server/ServerStream.h | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'lib') diff --git a/lib/server/ServerStream.h b/lib/server/ServerStream.h index d5abccdd..f8578a04 100644 --- a/lib/server/ServerStream.h +++ b/lib/server/ServerStream.h @@ -170,16 +170,22 @@ public: } else if(c[0] == "unix") { - // Check arguments size - if(c.size() != 2) - { - THROW_EXCEPTION(ServerException, ServerStreamBadListenAddrs) - } + #ifdef WIN32 + BOX_WARNING("Ignoring request to listen on a Unix socket on Windows: " << addrlist[a]); + delete psocket; + psocket = NULL; + #else + // Check arguments size + if(c.size() != 2) + { + THROW_EXCEPTION(ServerException, ServerStreamBadListenAddrs) + } - // unlink anything there - ::unlink(c[1].c_str()); - - psocket->Listen(Socket::TypeUNIX, c[1].c_str()); + // unlink anything there + ::unlink(c[1].c_str()); + + psocket->Listen(Socket::TypeUNIX, c[1].c_str()); + #endif // WIN32 } else { @@ -187,8 +193,11 @@ public: THROW_EXCEPTION(ServerException, ServerStreamBadListenAddrs) } - // Add to list of sockets - mSockets.push_back(psocket); + if (psocket != NULL) + { + // Add to list of sockets + mSockets.push_back(psocket); + } } catch(...) { @@ -196,8 +205,11 @@ public: throw; } - // Add to the list of things to wait on - connectionWait.Add(psocket); + if (psocket != NULL) + { + // Add to the list of things to wait on + connectionWait.Add(psocket); + } } } -- cgit v1.2.3