Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   Communications (http://www.xtremevbtalk.com/communications/)
-   -   UDP Winsock skips every other packet (http://www.xtremevbtalk.com/communications/327452-udp-winsock-skips-packet.html)

the master 12-29-2014 09:59 AM

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.

Code:

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 = "192.168.0.150"
    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?

dilettante 01-08-2015 01:49 PM

1 Attachment(s)
Weird one. Working fine here, whether testing within one machine or between two on the same LAN.

The attached Project uses a 5 second Timer, easily adjusted to 10 seconds. I just got bored waiting. ;)


One possibility:

The Winsock control had many little glitches when it came out and they only got fixed a few at a time. Make sure you have VB6 SP6 installed to get the most bug-free version. SP5 and earlier just don't cut the mustard.


All times are GMT -6. The time now is 02:35 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.