Valhalla Legends Forums Archive | Visual Basic Programming | Sending a disconnect notification packet?

AuthorMessageTime
JoeTheOdd
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?
December 4, 2005, 7:45 PM
JoeTheOdd
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. =)
December 4, 2005, 7:53 PM
UserLoser.
[quote author=Joe link=topic=13417.msg136359#msg136359 date=1133725548]
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]

SendPacket()
DoEvents

Usually works for simple, easy, lazy people
December 4, 2005, 10:24 PM
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.
December 8, 2005, 8:54 PM

Search