From 3667cec1f612e6a37479f99bd1fa23d92af7cff7 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 8 Mar 2010 23:16:35 +0000 Subject: Server socket has a few tweaks now. --- src/nids.h | 6 +++--- src/serversocket.cpp | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nids.h b/src/nids.h index 02d6cf4..0976e67 100644 --- a/src/nids.h +++ b/src/nids.h @@ -96,10 +96,10 @@ namespace Bu /*uint32_t uPrevBlock,*/ bool bNew=false ); uint32_t createBlock( uint32_t uFirstBlock, /*uint32_t uPrevBlock,*/ int iPreAllocate=1 ); - void getBlock( uint32_t uIndex, struct Nids::Block *pBlock ); - void setBlock( uint32_t uIndex, struct Nids::Block *pBlock ); + void getBlock( uint32_t uIndex, Block *pBlock ); + void setBlock( uint32_t uIndex, Block *pBlock ); void updateStreamSize( uint32_t uIndex, uint32_t uSize ); - uint32_t getNextBlock( uint32_t uIndex, struct Nids::Block *pBlock, + uint32_t getNextBlock( uint32_t uIndex, Block *pBlock, bool bCreate=true); void updateHeader(); 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 ) } Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) : nPort( nPort ) { +#ifdef WIN32 + Bu::Winsock2::getInstance(); +#endif + /* Create the socket and set it up to accept connections. */ struct sockaddr_in name; @@ -48,6 +52,10 @@ Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) : Bu::ServerSocket::ServerSocket(const FString &sAddr,int nPort, int nPoolSize) : nPort( nPort ) { +#ifdef WIN32 + Bu::Winsock2::getInstance(); +#endif + /* Create the socket and set it up to accept connections. */ struct sockaddr_in name; @@ -69,6 +77,10 @@ Bu::ServerSocket::ServerSocket( int nServer, bool bInit, int nPoolSize ) : nServer( nServer ), nPort( 0 ) { +#ifdef WIN32 + Bu::Winsock2::getInstance(); +#endif + if( bInit ) { struct sockaddr name; @@ -86,6 +98,10 @@ Bu::ServerSocket::ServerSocket( int nServer, bool bInit, int nPoolSize ) : Bu::ServerSocket::ServerSocket( const ServerSocket &rSrc ) { +#ifdef WIN32 + Bu::Winsock2::getInstance(); +#endif + nServer = dup( rSrc.nServer ); nPort = rSrc.nPort; FD_ZERO( &fdActive ); -- cgit v1.2.3