diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-11-05 22:41:51 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-11-05 22:41:51 +0000 |
commit | ec05778d5718a7912e506764d443a78d6a6179e3 (patch) | |
tree | 78a9a01532180030c095acefc45763f07c14edb8 /src/stable/multiserver.h | |
parent | b20414ac1fe80a71a90601f4cd1767fa7014a9ba (diff) | |
download | libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.gz libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.bz2 libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.xz libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.zip |
Converted tabs to spaces with tabconv.
Diffstat (limited to 'src/stable/multiserver.h')
-rw-r--r-- | src/stable/multiserver.h | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/stable/multiserver.h b/src/stable/multiserver.h index b2f633a..8a49bbd 100644 --- a/src/stable/multiserver.h +++ b/src/stable/multiserver.h | |||
@@ -13,45 +13,45 @@ | |||
13 | 13 | ||
14 | namespace Bu | 14 | namespace Bu |
15 | { | 15 | { |
16 | class Protocol; | 16 | class Protocol; |
17 | class Client; | 17 | class Client; |
18 | 18 | ||
19 | template<class T> | 19 | template<class T> |
20 | Protocol *genProtocol() | 20 | Protocol *genProtocol() |
21 | { | 21 | { |
22 | return new T; | 22 | return new T; |
23 | } | 23 | } |
24 | 24 | ||
25 | class MultiServer : protected Server | 25 | class MultiServer : protected Server |
26 | { | 26 | { |
27 | public: | 27 | public: |
28 | MultiServer(); | 28 | MultiServer(); |
29 | virtual ~MultiServer(); | 29 | virtual ~MultiServer(); |
30 | 30 | ||
31 | void addProtocol( Protocol *(*proc)(), int iPort, int nPoolSize=40 ); | 31 | void addProtocol( Protocol *(*proc)(), int iPort, int nPoolSize=40 ); |
32 | void addProtocol( Protocol *(*proc)(), const String &sAddr, int iPort, | 32 | void addProtocol( Protocol *(*proc)(), const String &sAddr, int iPort, |
33 | int nPoolSize=40 ); | 33 | int nPoolSize=40 ); |
34 | 34 | ||
35 | void scan() | 35 | void scan() |
36 | { | 36 | { |
37 | Server::scan(); | 37 | Server::scan(); |
38 | } | 38 | } |
39 | 39 | ||
40 | void setTimeout( int nTimeoutSec, int nTimeoutUSec=0 ) | 40 | void setTimeout( int nTimeoutSec, int nTimeoutUSec=0 ) |
41 | { | 41 | { |
42 | Server::setTimeout( nTimeoutSec, nTimeoutUSec ); | 42 | Server::setTimeout( nTimeoutSec, nTimeoutUSec ); |
43 | } | 43 | } |
44 | 44 | ||
45 | virtual void onNewConnection( Client *pClient, int nPort ); | 45 | virtual void onNewConnection( Client *pClient, int nPort ); |
46 | virtual void onClosedConnection( Client *pClient ); | 46 | virtual void onClosedConnection( Client *pClient ); |
47 | 47 | ||
48 | void shutdown(); | 48 | void shutdown(); |
49 | 49 | ||
50 | void tick(); | 50 | void tick(); |
51 | 51 | ||
52 | private: | 52 | private: |
53 | Bu::Hash<int, Protocol *(*)()> hProtos; | 53 | Bu::Hash<int, Protocol *(*)()> hProtos; |
54 | }; | 54 | }; |
55 | } | 55 | } |
56 | 56 | ||
57 | #endif | 57 | #endif |