summaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 861e2e3..cca486a 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -109,10 +109,39 @@ void Bu::Server::addClient( int nSocket, int nPort )
109 FD_SET( nSocket, &fdActive ); 109 FD_SET( nSocket, &fdActive );
110 110
111 Client *c = new Client( 111 Client *c = new Client(
112 new Bu::Socket( nSocket ) 112 new Bu::Socket( nSocket ),
113 new SrvClientLinkFactory()
113 ); 114 );
114 hClients.insert( nSocket, c ); 115 hClients.insert( nSocket, c );
115 116
116 onNewConnection( c, nPort ); 117 onNewConnection( c, nPort );
117} 118}
118 119
120Bu::Server::SrvClientLink::SrvClientLink( Bu::Client *pClient ) :
121 pClient( pClient )
122{
123}
124
125Bu::Server::SrvClientLink::~SrvClientLink()
126{
127}
128
129void Bu::Server::SrvClientLink::sendMsg( const Bu::FString &sMsg )
130{
131 pClient->onMessage( sMsg );
132}
133
134Bu::Server::SrvClientLinkFactory::SrvClientLinkFactory()
135{
136}
137
138Bu::Server::SrvClientLinkFactory::~SrvClientLinkFactory()
139{
140}
141
142Bu::ClientLink *Bu::Server::SrvClientLinkFactory::createLink(
143 Bu::Client *pClient )
144{
145 return new SrvClientLink( pClient );
146}
147