Hi,
I'm using WIZ820I= with W5200.
This is what I do after connecting and stuff:
[quote:ffc72093af] 'TCP send
Result_socketstat = Socketstat(rec_socket , Sel_control) 'SocketStatus rec_socket aktualisieren
Select Case Result_socketstat
Case &H17 'connected
Reset Watchdog
Result = Tcpwritestr(rec_socket , Rec_tele , 255)
If Result > 0 Then
Rec_tele = ""
Alive_interval_cnt = 0
Socketdisconnect Rec_socket
Reset Led1
End If
Case Else 'exeption
Socketdisconnect Rec_socket
End Select[/quote:ffc72093af]
The crutial point is the "socketdisconnect" right after TCPWRITESTR.
Works fine in many cases, but I encoutered a problem:
If I connect to a second WIZ820IO, sometimes I receive the message, sometimes I don't.
I found out following:
The Server listens, client connects, connection is established. Server reads from buffer, Client disconnects, connection is closed.
If the Server has not finished reading the buffer, while Client disconnects, then the Server does not, or not completly, read the buffer!
It works, if I put a WAITMS 500 before the Clients disconnects. But I dont want that!
Is there a way to determin if transmission is complete, from the clients point of view?
Some kind of ACK that I can receive?
For some reasons I can not:
- wait 500ms
- send an ACK from server to client via TCPWRITE
↧