Hello all,

I've been playing around some more with the winsock control, but I can't get the SendProgress event working satisfactorily..

The code below will not run properly, when I run it, I believe something like this happens:
1) VB goes through SendProgress
2) VB then goes to DataArrival
3) Now the problem is like as though VB goes through DataArrived again, but this time GetData is empty. What causes it to be empty? If SendProgress did not exist, the program runs fine and only goes through DataArrival once. (I know this because I put MsgBox data to see what was received, it received fine, but it unexpectedly showed up a second time with nothing, which caused an error in my parsing code)

Code:
Private Sub Winsock1_SendProgress(ByVal bytesSent As Long, ByVal bytesRemaining As Long)
    Dim total As Long
    total = Len(fullsend) 'fullsend is the msg that is sent
    frmSending.ProgressBar1.Max = total
    frmSending.Visible = True
    frmSending.ProgressBar1.Value = bytesSent
End Sub

'and on a separate form, with a separate winsock1
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    Dim fullmsg As String
    Winsock1.GetData fullmsg
    'alot of parsing code here
End Sub
Right now, my temporary solution is:
Code:
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    Dim fullmsg As String
    Winsock1.GetData fullmsg
    If fullmsg <> "" Then
       'alot of parsing code here
    End If
End Sub
Although I have a solution, I'd really like to know what is causing this, and a proper way around it. MSDN didn't mention anything related to this..


Thanks
Sunny