On Fri, Jul 29, 2005 at 09:56:06PM +0530, Abhishek Jain wrote:
> The server on successful connection by a client sends a welcome
> message . Client sends a request and server responds and immediately
> after that the conversation must stop.
1. Client connects.
2. Server says hello.
3. Client sends request.
4. Server sends response.
5. Server closes connection after response is flushed.
> I have tried writing $_[KERNEL]->yield("shutdown") code in the
> ServerFlushed but the control perhaps do not passes to this function
> .
The steps above show that the server must initiate the disconnection
after the response is sent. The server does not have a ServerFlushed
callback. Rather, it has a ClientFlushed, but you should not need to
use it in most cases.
POE::Component::Server::TCP contains logic to automatically delay the
shutdown until all buffered output is flushed. Therefore you may call
$_[KERNEL]->yield("shutdown") immediately after sending the response
in #4. The server component will ensure the response is sent.
> Also i would like to see suggestions that whether this server can
> handle multiple simultaneous connections from many different
> clients.
POE::Component::Server::TCP handles multiple concurrent connections.
--
Rocco Caputo - http://poe.perl.org/
|