diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-10-16 03:02:11 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-10-16 03:02:11 +0000 |
commit | 9031e2af7dd4e65ec70890ee78a7cf600d1b2cc5 (patch) | |
tree | 17bc9d96b13d16d79385016c087321fc1267743f /src/server.cpp | |
parent | 93c028162318a00b9bd03fc4a48383f830cc529d (diff) | |
download | libbu++-9031e2af7dd4e65ec70890ee78a7cf600d1b2cc5.tar.gz libbu++-9031e2af7dd4e65ec70890ee78a7cf600d1b2cc5.tar.bz2 libbu++-9031e2af7dd4e65ec70890ee78a7cf600d1b2cc5.tar.xz libbu++-9031e2af7dd4e65ec70890ee78a7cf600d1b2cc5.zip |
Many, many changes. Documentation changes, renamed the socket class to
TcpSocket, fixed many other things, and finally removed ParamProc. Anything
that needs it will now have to switch to OptParser.
Diffstat (limited to '')
-rw-r--r-- | src/server.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/server.cpp b/src/server.cpp index 51c056a..e701a69 100644 --- a/src/server.cpp +++ b/src/server.cpp | |||
@@ -8,9 +8,9 @@ | |||
8 | #include "bu/server.h" | 8 | #include "bu/server.h" |
9 | #include <errno.h> | 9 | #include <errno.h> |
10 | #include <unistd.h> | 10 | #include <unistd.h> |
11 | #include "bu/serversocket.h" | 11 | #include "bu/tcpserversocket.h" |
12 | #include "bu/client.h" | 12 | #include "bu/client.h" |
13 | #include "bu/socket.h" | 13 | #include "bu/tcpsocket.h" |
14 | #include "bu/config.h" | 14 | #include "bu/config.h" |
15 | 15 | ||
16 | Bu::Server::Server() : | 16 | Bu::Server::Server() : |
@@ -28,7 +28,7 @@ Bu::Server::~Server() | |||
28 | 28 | ||
29 | void Bu::Server::addPort( int nPort, int nPoolSize ) | 29 | void Bu::Server::addPort( int nPort, int nPoolSize ) |
30 | { | 30 | { |
31 | ServerSocket *s = new ServerSocket( nPort, nPoolSize ); | 31 | TcpServerSocket *s = new TcpServerSocket( nPort, nPoolSize ); |
32 | int nSocket = s->getSocket(); | 32 | int nSocket = s->getSocket(); |
33 | FD_SET( nSocket, &fdActive ); | 33 | FD_SET( nSocket, &fdActive ); |
34 | hServers.insert( nSocket, s ); | 34 | hServers.insert( nSocket, s ); |
@@ -36,7 +36,7 @@ void Bu::Server::addPort( int nPort, int nPoolSize ) | |||
36 | 36 | ||
37 | void Bu::Server::addPort( const FString &sAddr, int nPort, int nPoolSize ) | 37 | void Bu::Server::addPort( const FString &sAddr, int nPort, int nPoolSize ) |
38 | { | 38 | { |
39 | ServerSocket *s = new ServerSocket( sAddr, nPort, nPoolSize ); | 39 | TcpServerSocket *s = new TcpServerSocket( sAddr, nPort, nPoolSize ); |
40 | int nSocket = s->getSocket(); | 40 | int nSocket = s->getSocket(); |
41 | FD_SET( nSocket, &fdActive ); | 41 | FD_SET( nSocket, &fdActive ); |
42 | hServers.insert( nSocket, s ); | 42 | hServers.insert( nSocket, s ); |
@@ -75,7 +75,7 @@ void Bu::Server::scan() | |||
75 | { | 75 | { |
76 | if( hServers.has( j ) ) | 76 | if( hServers.has( j ) ) |
77 | { | 77 | { |
78 | ServerSocket *pSrv = hServers.get( j ); | 78 | TcpServerSocket *pSrv = hServers.get( j ); |
79 | addClient( pSrv->accept(), pSrv->getPort() ); | 79 | addClient( pSrv->accept(), pSrv->getPort() ); |
80 | } | 80 | } |
81 | else | 81 | else |
@@ -97,7 +97,7 @@ void Bu::Server::scan() | |||
97 | { | 97 | { |
98 | pClient->processOutput(); | 98 | pClient->processOutput(); |
99 | } | 99 | } |
100 | catch( Bu::SocketException &e ) | 100 | catch( Bu::TcpSocketException &e ) |
101 | { | 101 | { |
102 | closeClient( j ); | 102 | closeClient( j ); |
103 | } | 103 | } |
@@ -136,7 +136,7 @@ void Bu::Server::addClient( int nSocket, int nPort ) | |||
136 | FD_SET( nSocket, &fdActive ); | 136 | FD_SET( nSocket, &fdActive ); |
137 | 137 | ||
138 | Client *c = new Client( | 138 | Client *c = new Client( |
139 | new Bu::Socket( nSocket ), | 139 | new Bu::TcpSocket( nSocket ), |
140 | new SrvClientLinkFactory() | 140 | new SrvClientLinkFactory() |
141 | ); | 141 | ); |
142 | hClients.insert( nSocket, c ); | 142 | hClients.insert( nSocket, c ); |