aboutsummaryrefslogtreecommitdiff
path: root/src/stable/server.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 };