Open GoogleCodeExporter opened 9 years ago
Only when the whole process is quit, RST packet will be sent.
Original comment by mmikk...@gmail.com
on 15 Jun 2011 at 1:38
I think you have to close the client connections separately, too. Closing the
listening port is not enough. I added something like this in spiocpserver.cpp,
SP_IocpServer :: start() (after while( 0 == mIsShutdown ) loop) and that did
the trick:
SP_Sid_t sid;
SP_Session * session;
if( eventArg.getSessionManager()->getIteratorBegin(&sid) )
{
do
{
session = eventArg.getSessionManager()->get(sid.mKey,&sid.mSeq);
SP_IocpEventHelper::close(session);
}while(eventArg.getSessionManager()->getIteratorNext(sid, &sid));
}
I added that getIteratorBegin in SP_SessionManager class and it gets the first
sid in mArray, and getIteratorNext gets the next. They both return boolean
true/false if there's success/failure respectively.
Maybe the developers could do this in a more sophisticated way? It's probably
bad practise to make these functions in SP_SessionManager(?). There seems to be
a doClose function in SP_IocpEventHelper, which adds some sort of closing task,
so maybe this could be used. But what do I know, I'm not an expert on this.
Original comment by mmikk...@gmail.com
on 18 Jun 2011 at 1:20
Original issue reported on code.google.com by
mmikk...@gmail.com
on 15 Jun 2011 at 1:35