closing ASyncSocket



I had asked part of this in another thread but i have more related questions
so I repeat one part.

1. When is it safe after sending to call Close()? I have it implemented now
where I close from within the OnSend() call when I have no further data to
send. I thought that means the data is safely underway. But it seems that
sometimes the data is received on the other side and sometimes it isn't. I'm
not sure if the connection being closed before the other side reads the data
out is the cause of the problem or if I maybe have another problem.

2. Then because of that problem, I decided to try Close()ing on the
receiving side (Server) after I received the last data. This was an
improvement because the data was always received. But it seems the sending
side (Client) doesn't realize the connection is closed. It does get the
OnClose() call. But when I try to initiate another transaction by having the
client connect to the server, it gets an error that it is already connected
(10056). Do I need to call Close() from within the OnClose() call triggered
by the other side?

I'm sure i'll have more later. Thanks...


.



Relevant Pages

  • The remote peer is no longer responding
    ... " Secure VPN connection terminated locally by the Client. ... RECEIVING <<< ISAKMP OAK AG, VID, VID, KE, ID, ... Crypto Active IKE SA, ...
    (comp.dcom.sys.cisco)
  • Re: closing ASyncSocket
    ... receiving side after I received the last data. ... side (Client) doesn't realize the connection is closed. ... Do I need to call Closefrom within the OnClose() call triggered ...
    (microsoft.public.vc.mfc)
  • Re: closing ASyncSocket
    ... What if I want to Closethe connection to return resources. ... ShutDown() first to flush the send then call Closeto close? ... either side and will the opposite side always get the OnClose() call? ... receiving side after I received the last data. ...
    (microsoft.public.vc.mfc)
  • Re: Securing socket server
    ... If a particular client IP ... future connection attempts from that IP will be dropped. ... > command is received or if you know that no more than a certain ... > text in the ruotine where you get the command check if the receiving ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how to set the idle-timeout in linux SSH
    ... > received from the client, ... > sent without sshd receiving any messages back ... > or server depend on knowing when a connection ...
    (Fedora)