Hi, I'm a new user of the poco library (BTW, great job folks), and I have little questions regarding the socket reactor implementation.
My server will be using long lasting connections and many clients will be permanently connected to it. So that's why I want to use the socket reactor since its using a thread for all clients beside a thread per client like the TCPServer implementation (I'm right?).
The catch is that my server needs to dispatch packets to other clients depending of one client's packet. It will have multiple requests processed concurrently. So here's my implementation:
Classes:
SocketReactor
Modified SocketAcceptor that links a reference of the ClientManager with a ClientHandler
ClientHandler
ClientsManager
In this one, there's a hash containing the clients sockets so I can dispatch the packets to other clients. It has a threadpool, a tasklist and a taskmanager, and launches taskes if threads are available. Its an independant class that is friend with the clienthandler class and it runs in its own thread. A task class (inherited from Poco::Task) calls a function in clientManager to send the data to other clients.
First, if would like to know if this implementation makes sense with the Reactor pattern or my design is bad or how I could design it to get rid of my hash containing sockets (I know I could modify socketreactor.cpp, but I want my implementation to be independent of poco)
Thanks,
Phil





