• Welcome to Valhalla Legends Archive.
 

Sending a disconnect notification packet?

Started by Joe[x86], December 04, 2005, 01:45 PM

Previous topic - Next topic

Joe[x86]

Yup. I've got a program (my client for my final VB project) that connects on start, and disconnects on end. The problem though, is that the packet that's sent right before disconnection isn't received.

Does anyone know how to fix this?
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Joe[x86]

In Form_Unload I set my global variable g_bQuit to true and cancel to 1, and in sckConnection_SendProgress, I check if bytesRemaining is 0, and g_bQuit is true. If it is, then I quit.

That way, I don't close the socket until sending has finished. =)
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

UserLoser.

Quote from: Joe on December 04, 2005, 01:45 PM
Yup. I've got a program (my client for my final VB project) that connects on start, and disconnects on end. The problem though, is that the packet that's sent right before disconnection isn't received.

Does anyone know how to fix this?

SendPacket()
DoEvents

Usually works for simple, easy, lazy people

Grok

Well keep in mind that according to TCP specification, at the application level you do not know when your packets get sent.  The guarantees are only that the data will get sequentially and that if not sent, you will get a notification.  If you have sent some data (which is queued to go as TCP decides to actually send it) then close the connection, it may be undefined what happens to the queued packets.

Someone (Kp or Adron) may have knowledge of what is supposed to happen.  Or someone can go read the RFC to find out what is defined.