|
int
Supplier_Handler::handle_input (ACE_HANDLE)
{
char buf[BUFSIZ];
ssize_t received = this->peer ().recv (buf, sizeof buf);
switch (received)
{
case -1:
this->state (Connection_Handler::FAILED);
ACE_ERROR_RETURN ((LM_ERROR,
"(%t) Peer has failed unexpectedly for Client_Handler %d\n",
this->connection_id ()),
-1);
/* NOTREACHED */
case 0:
this->state (Connection_Handler::FAILED);
ACE_ERROR_RETURN ((LM_ERROR,
"(%t) Peer has shutdown unexpectedly for Client_Handler %d\n",
this->connection_id ()),
-1);
/* NOTREACHED */
default:
ACE_DEBUG((LM_DEBUG,"(%t) from %d: %s %d \n",connection_id_,buf,received));
return 0;
}
}
为什么当对面连接关闭的时候,调用handle_input时候,buf字符组不是空,还是上次收到的字符值! |
|