SOCK_FIN_WAIT, SnRX_RSR transient issues
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: SOCK_FIN_WAIT, SnRX_RSR transient issues
by Bill2009 ·
Thank you. I am away from home for a couple of weeks but i will capture it with wireshark in April.
RE: SOCK_FIN_WAIT, SnRX_RSR transient issues
by Bill2009 ·
Ok: I can easily recreate the problem and I have tried to capture it.
In this case the client ip is 24.114.86.112 and the server is 192.168.1.182.
Client sends an HTTP GET, the socket status goes to 17 - session established but when I read SnRX_RSR I get 0 for approximately 200 ms. Then SnRX_RSR shows the proper length 381. I have attached the wireshark capture print as well as screengrabs of the tcp stream content and packets.
I did capture everything but I’ve limited the uploads to the tcp stream. if there’s more that would be a help please let me know.
0length.wireshark.txt (12.8 KB)
RE: SOCK_FIN_WAIT, SnRX_RSR transient issues
by Coccoliso ·
I looked at the source code and I saw that you have a delay(200) in the main loop of which escapes me the utility.
Checking the status of the socket should be managed continuously.
RE: SOCK_FIN_WAIT, SnRX_RSR transient issues
by Bill2009 ·
Thanks for looking at the code. I have a 100ms delay in the main loop because i sometimes stream the status codes to a serial port and i don’t want to flood it.
I reduced the delay to 1ms and I found the transient 0 length happened almost every time whether the client was on the local network or not. My conclusion is that there is a perceptible lag between when the socket status goes to 17 and when the data is available.
I can live with the retries except that Chrome frequently causes a session to be established with 0 data and this never resolves so the server spins its wheels for 200ms waiting for something that never happens.
I don’t have directly comparable code but I have tried this with the W5200 and the transient 0 size does occur but less frequently. I had not seen it before because the 100ms delay pretty well masks it.
RE: SOCK_FIN_WAIT, SnRX_RSR transient issues
by Bill2009 ·
On the question of SOCK_FIN_WAIT, I tried having the server issue CR_CLOSE rather than CR_DISCON when it was done sending a response. This leaves the browser(chrome, local) hung for about 45 seconds then clears - some sort of timeout. Not a good idea. I have gone back to the original code of issuing CR_DISCON to end a session and only issuing CR_CLOSE if I see the SFW status. This seems to be fine.