|
发表于 2009-9-11 12:45:34
|
显示全部楼层
看APG7.2节
int
ClientAcceptor::handle_input (ACE_HANDLE)
{
ClientService *client;
ACE_NEW_RETURN (client, ClientService, -1);
auto_ptr<ClientService> p (client);
if (this->acceptor_.accept (client->peer ()) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("(%P|%t) %p\n"),
ACE_TEXT ("Failed to accept ")
ACE_TEXT ("client connection")),
-1);
p.release ();
client->reactor (this->reactor ());
if (client->open () == -1)
client->handle_close (ACE_INVALID_HANDLE, 0);
return 0;
}
在这里建立一个map就可以了,然后在楼主需要的时候,根据map的key索引到ClientService的指针,
然后楼主想怎么玩都行了。 |
|