View Single Post
Old 12-29-2014, 09:59 AM
the master's Avatar
the master the master is offline
Join Date: Mar 2003
Location: Mansfield, UK
Posts: 4,596
Default UDP Winsock skips every other packet

Hi, I have a UDP Winsock control that sends 3 bytes of data every 10 seconds. The problem is that every 2nd packet doesn't get sent.

Private Sub Form_Load()

    sckCom.Bind 775
End Sub

Private Sub tmrPing_Timer()
    Dim temp() As Byte
    ReDim temp(2)
    temp(0) = 1
    temp(1) = 0
    temp(2) = 0
    sckCom.RemotePort = 775
    sckCom.RemoteHost = ""
    sckCom.SendData temp()
End Sub
I've added a break point and can confirm the timer is definitely firing every 10 seconds.
I'm using Wireshark on the same PC to check the packets and it shows that packets are only going out every 20 seconds.
Even if I use a breakpoint to delay the 2nd packet it still won't send.
The state is always 1 (sckOpen) right before .SendData is called
The Winsock control is receiving all data sent to it without a problem.

Is there something I need to do to "reset" the socket or it's buffers between sends?
"That which seems simple is often overlooked" ~ me
Halloween 2014 Yard Haunt
Halloween Special FX
Reply With Quote