View Single Post
  #2 (permalink)  
Old February 20th, 2002
Moak's Avatar
Moak Moak is offline
Guest
 
Join Date: September 7th, 2001
Location: Europe
Posts: 816
Moak is flying high
Default

It seems you try a friendly shutdown, while Max from Mutella loves it the hard way to disconnect.

About friendly disconnect, shouldn't it be:

while(m_bDataSending && !m_bForceDisconnect); //wait until send buffer cleared
AsyncSelect(0);
Shutdown(1); //perform a friendly TCP shutdowm
while(Receive(m_aBuffer, sizeof(m_aBuffer))>0 && !m_bForceDisconnect);
CAsyncSocket::Close()

Greets, Moak

PS: Okay this doesn't work too. Since there is no possibility to get interrupted by a class method that sets m_bForceDisconnect. Perhaps it's a conceptional design weakness in CAsyncSocket?

Last edited by Moak; February 20th, 2002 at 06:38 AM.
Reply With Quote