I can't change the server side: protocol, add SYN/ACK, etc. So I need find the way at client side. The provider of server board supplied a manager program. It acquires data without data lost. So I think there is not problem in the platform on my computer.
Thanks for all of your support but I hope you can help me to find the way at client side (my program). Don't refer to change to TCP or other protocols or add any flowcontrol because my server can't be change.
In my program, I using hooking, WSAAsyncSelect function and checking FD_READ event to receive data. But if server sent 1000 packets (900 bytes). My program received FD_READ event quantity no enough (<1000, normally 600 -> 700 packets). What is wrong?
Public Sub ProcessMessage(ByVal lFromSocket As Long, ByVal lParam As Long)
Dim X As Long
Dim sockout As SOCKADDR
Dim sockaddrsize As Long
if FD_READ = lParam then
sockout = saZero
sockout.sin_family = AF_INET
sockout.sin_port = htons(PORT_TO_CONNECT)
sockout.sin_addr = GetHostByNameAlias(SERVER_TO_CONNECT)
sockaddrsize = Len(sockout)
strData = ""
'Do
X = recvfrom(lFromSocket, ReadBuffer(1), 1048576, 0, sockout, sockaddrsize)
If X > 0 Then
strData = strData & Left$(StrConv(ReadBuffer, vbUnicode), X)
End If
'Loop Until X = 0 Or X = SOCKET_ERROR
If strData <> "" Then
vSamples = vSamples + 1
Put FileNum, , strData
End If
End If
End Sub