ACE_REACTOR handle_close 问题

15 views
Skip to first unread message

海峰

unread,
Nov 25, 2008, 8:49:51 PM11/25/08
to ace-china
ace_reactor 在对端异常退出后,不能调用handle_close 问题解决方法
1. 是定时自动检测
2 set_option()
有没有人试过第二种方法,请教下注意问题

ben

unread,
Dec 3, 2008, 9:32:08 PM12/3/08
to ace-china
昨天写的跑哪里去了?为什么我不能跟贴?郁闷

ben

unread,
Dec 3, 2008, 9:43:40 AM12/3/08
to ace-china
不过不推荐使用,第一种方法还是比较可靠
//检测对方是否存活, 如果对方网线被拔掉,35秒后即可知道
// int Opt = 1;
// tcp_keepalive live,liveout;
// live.keepaliveinterval=5000;
// live.keepalivetime=10000;
// live.onoff=TRUE;
// int iRet = stream.set_option(SOL_SOCKET,SO_KEEPALIVE,&Opt,sizeof
(int));
// if(iRet == 0){
//
// DWORD dw;
//
// if(WSAIoctl((SOCKET)h,SIO_KEEPALIVE_VALS,&live,sizeof
(live),&liveout,sizeof(liveout),&dw,NULL,NULL)== SOCKET_ERROR){
//
// //Delete Client
//
// return;
// }
// }

On 11月26日, 上午9时49分, 海峰 <Tanghaifeng.Yan...@gmail.com> wrote:

tomas

unread,
Dec 8, 2008, 9:23:26 PM12/8/08
to ace-china
谢谢 ben!
Reply all
Reply to author
Forward
0 new messages