diff options
Diffstat (limited to 'src/serversocket.cpp')
-rw-r--r-- | src/serversocket.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/serversocket.cpp b/src/serversocket.cpp index b711320..37eb3d4 100644 --- a/src/serversocket.cpp +++ b/src/serversocket.cpp | |||
@@ -31,6 +31,10 @@ namespace Bu { subExceptionDef( ServerSocketException ) } | |||
31 | Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) : | 31 | Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) : |
32 | nPort( nPort ) | 32 | nPort( nPort ) |
33 | { | 33 | { |
34 | #ifdef WIN32 | ||
35 | Bu::Winsock2::getInstance(); | ||
36 | #endif | ||
37 | |||
34 | /* Create the socket and set it up to accept connections. */ | 38 | /* Create the socket and set it up to accept connections. */ |
35 | struct sockaddr_in name; | 39 | struct sockaddr_in name; |
36 | 40 | ||
@@ -48,6 +52,10 @@ Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) : | |||
48 | Bu::ServerSocket::ServerSocket(const FString &sAddr,int nPort, int nPoolSize) : | 52 | Bu::ServerSocket::ServerSocket(const FString &sAddr,int nPort, int nPoolSize) : |
49 | nPort( nPort ) | 53 | nPort( nPort ) |
50 | { | 54 | { |
55 | #ifdef WIN32 | ||
56 | Bu::Winsock2::getInstance(); | ||
57 | #endif | ||
58 | |||
51 | /* Create the socket and set it up to accept connections. */ | 59 | /* Create the socket and set it up to accept connections. */ |
52 | struct sockaddr_in name; | 60 | struct sockaddr_in name; |
53 | 61 | ||
@@ -69,6 +77,10 @@ Bu::ServerSocket::ServerSocket( int nServer, bool bInit, int nPoolSize ) : | |||
69 | nServer( nServer ), | 77 | nServer( nServer ), |
70 | nPort( 0 ) | 78 | nPort( 0 ) |
71 | { | 79 | { |
80 | #ifdef WIN32 | ||
81 | Bu::Winsock2::getInstance(); | ||
82 | #endif | ||
83 | |||
72 | if( bInit ) | 84 | if( bInit ) |
73 | { | 85 | { |
74 | struct sockaddr name; | 86 | struct sockaddr name; |
@@ -86,6 +98,10 @@ Bu::ServerSocket::ServerSocket( int nServer, bool bInit, int nPoolSize ) : | |||
86 | 98 | ||
87 | Bu::ServerSocket::ServerSocket( const ServerSocket &rSrc ) | 99 | Bu::ServerSocket::ServerSocket( const ServerSocket &rSrc ) |
88 | { | 100 | { |
101 | #ifdef WIN32 | ||
102 | Bu::Winsock2::getInstance(); | ||
103 | #endif | ||
104 | |||
89 | nServer = dup( rSrc.nServer ); | 105 | nServer = dup( rSrc.nServer ); |
90 | nPort = rSrc.nPort; | 106 | nPort = rSrc.nPort; |
91 | FD_ZERO( &fdActive ); | 107 | FD_ZERO( &fdActive ); |