aboutsummaryrefslogtreecommitdiff
path: root/src/stable/server.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-08-28 17:42:54 +0000
committerMike Buland <eichlan@xagasoft.com>2012-08-28 17:42:54 +0000
commit411cdf39fc2b961a970a0ae91b9059614251247e (patch)
tree935afa56c11aef0fb769e63659970e7d033a99e8 /src/stable/server.h
parentfc5132d68ae9e6afdbd0b5a687ba81c88fc84826 (diff)
downloadlibbu++-411cdf39fc2b961a970a0ae91b9059614251247e.tar.gz
libbu++-411cdf39fc2b961a970a0ae91b9059614251247e.tar.bz2
libbu++-411cdf39fc2b961a970a0ae91b9059614251247e.tar.xz
libbu++-411cdf39fc2b961a970a0ae91b9059614251247e.zip
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().
Diffstat (limited to 'src/stable/server.h')
-rw-r--r--src/stable/server.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/stable/server.h b/src/stable/server.h
index 68e5205..5a414d9 100644
--- a/src/stable/server.h
+++ b/src/stable/server.h
@@ -55,13 +55,19 @@ namespace Bu
55 Server(); 55 Server();
56 virtual ~Server(); 56 virtual ~Server();
57 57
58#ifdef WIN32
59 typedef unsigned int socket_t;
60#else
61 typedef int socket_t;
62#endif
63
58 void addPort( int nPort, int nPoolSize=40 ); 64 void addPort( int nPort, int nPoolSize=40 );
59 void addPort( const String &sAddr, int nPort, int nPoolSize=40 ); 65 void addPort( const String &sAddr, int nPort, int nPoolSize=40 );
60 66
61 virtual void scan(); 67 virtual void scan();
62 void setTimeout( int nTimeoutSec, int nTimeoutUSec=0 ); 68 void setTimeout( int nTimeoutSec, int nTimeoutUSec=0 );
63 69
64 void addClient( int nSocket, int nPort ); 70 void addClient( socket_t nSocket, int nPort );
65 71
66 void setAutoTick( bool bEnable=true ); 72 void setAutoTick( bool bEnable=true );
67 void tick(); 73 void tick();
@@ -72,7 +78,7 @@ namespace Bu
72 void shutdown(); 78 void shutdown();
73 79
74 private: 80 private:
75 void closeClient( int iSocket ); 81 void closeClient( socket_t iSocket );
76 class SrvClientLink : public Bu::ClientLink 82 class SrvClientLink : public Bu::ClientLink
77 { 83 {
78 public: 84 public:
@@ -97,9 +103,9 @@ namespace Bu
97 int nTimeoutSec; 103 int nTimeoutSec;
98 int nTimeoutUSec; 104 int nTimeoutUSec;
99 fd_set fdActive; 105 fd_set fdActive;
100 typedef Hash<int,TcpServerSocket *> SrvHash; 106 typedef Hash<socket_t,TcpServerSocket *> SrvHash;
101 SrvHash hServers; 107 SrvHash hServers;
102 typedef Hash<int,Client *> ClientHash; 108 typedef Hash<socket_t,Client *> ClientHash;
103 ClientHash hClients; 109 ClientHash hClients;
104 bool bAutoTick; 110 bool bAutoTick;
105 }; 111 };