From 411cdf39fc2b961a970a0ae91b9059614251247e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 28 Aug 2012 17:42:54 +0000 Subject: Loads of win32 compilation issues fixed. Most are fairly minor unsigned/signed mismatches because of socket handles, but there were also some order-of-definition issues that were fixed in the FD_SETSIZE definition code. Fixed a few things that just never worked on windows, like Bu::Thread::yield(). --- src/unstable/itoserver.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/unstable/itoserver.h') diff --git a/src/unstable/itoserver.h b/src/unstable/itoserver.h index 57fece3..6a0df56 100644 --- a/src/unstable/itoserver.h +++ b/src/unstable/itoserver.h @@ -58,13 +58,19 @@ namespace Bu ItoServer(); virtual ~ItoServer(); +#ifdef WIN32 + typedef unsigned int socket_t; +#else + typedef int socket_t; +#endif + void addPort( int nPort, int nPoolSize=40 ); void addPort( const String &sAddr, int nPort, int nPoolSize=40 ); //void scan(); void setTimeout( int nTimeoutSec, int nTimeoutUSec=0 ); - void addClient( int nSocket, int nPort ); + void addClient( socket_t nSocket, int nPort ); virtual void onNewConnection( Client *pClient, int nPort )=0; virtual void onClosedConnection( Client *pClient )=0; @@ -78,7 +84,7 @@ namespace Bu { friend class Bu::ItoServer::SrvClientLink; public: - ItoClient( ItoServer &rSrv, int nSocket, int nPort, + ItoClient( ItoServer &rSrv, socket_t nSocket, int nPort, int nTimeoutSec, int nTimeoutUSec ); virtual ~ItoClient(); @@ -92,7 +98,7 @@ namespace Bu ItoServer &rSrv; Client *pClient; fd_set fdActive; - int iSocket; + socket_t iSocket; int iPort; int nTimeoutSec; int nTimeoutUSec; @@ -126,15 +132,15 @@ namespace Bu int nTimeoutSec; int nTimeoutUSec; fd_set fdActive; - typedef Hash ServerHash; + typedef Hash ServerHash; ServerHash hServers; - typedef Hash ClientHash; + typedef Hash ClientHash; typedef SynchroQueue ClientQueue; ClientHash hClients; ClientQueue qClientCleanup; Mutex imClients; - void clientCleanup( int iSocket ); + void clientCleanup( socket_t iSocket ); }; } -- cgit v1.2.3