I am attempting to create a server application (VB) that takes a data stream from a socket, and puts it into a database. I get this data stream in "chunks", and after each chunk, I need to send data back to the client saying that I got the last chunk, ready for another (acknowledgment, of sorts).
I've got it all working, except sending the acknowledgement data back to the client. It needs to be on the same socket, and I don't get an error on the VB server application, but I also don't see the data on the client application (which is not VB).
Am I not doing something I should be? My code (in essence) is:
Private Sub sock_DataArrival(ByVal bytesTotal As Long)
Dim temp_strData As String
Dim len_tempStrData As Long
sock.GetData temp_strData
strData = strData & temp_strData
len_tempStrData = Len(temp_strData)
parseDataStream (strData) 'function that puts data into DB
strData = ""
'Acknowledge the message
If sock.State = sckConnected Then
sock.SendData (Chr(11) & "ACK" & Chr(28) & Chr(13))
Else
MsgBox "ERROR: Ack not returned."
End If
End Sub
I've got it all working, except sending the acknowledgement data back to the client. It needs to be on the same socket, and I don't get an error on the VB server application, but I also don't see the data on the client application (which is not VB).
Am I not doing something I should be? My code (in essence) is:
Private Sub sock_DataArrival(ByVal bytesTotal As Long)
Dim temp_strData As String
Dim len_tempStrData As Long
sock.GetData temp_strData
strData = strData & temp_strData
len_tempStrData = Len(temp_strData)
parseDataStream (strData) 'function that puts data into DB
strData = ""
'Acknowledge the message
If sock.State = sckConnected Then
sock.SendData (Chr(11) & "ACK" & Chr(28) & Chr(13))
Else
MsgBox "ERROR: Ack not returned."
End If
End Sub