aboutsummaryrefslogtreecommitdiff
path: root/src/serversocket.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-03-08 23:16:35 +0000
committerMike Buland <eichlan@xagasoft.com>2010-03-08 23:16:35 +0000
commit3667cec1f612e6a37479f99bd1fa23d92af7cff7 (patch)
tree819f386631dd338b765165c3a5312ef65c06752c /src/serversocket.cpp
parentd31d089ea7a0545c3e72584b572f9a21ae15f8b4 (diff)
downloadlibbu++-3667cec1f612e6a37479f99bd1fa23d92af7cff7.tar.gz
libbu++-3667cec1f612e6a37479f99bd1fa23d92af7cff7.tar.bz2
libbu++-3667cec1f612e6a37479f99bd1fa23d92af7cff7.tar.xz
libbu++-3667cec1f612e6a37479f99bd1fa23d92af7cff7.zip
Server socket has a few tweaks now.
Diffstat (limited to '')
-rw-r--r--src/serversocket.cpp16
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 ) }
31Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) : 31Bu::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 ) :
48Bu::ServerSocket::ServerSocket(const FString &sAddr,int nPort, int nPoolSize) : 52Bu::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
87Bu::ServerSocket::ServerSocket( const ServerSocket &rSrc ) 99Bu::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 );