Web server unreliable when queried from foreign country
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: Web server unreliable when queried from foreign country
by Eugeny ·
Sounds like all your TCP sockets are stuck open for some reason. Most probably - software can not close them properly, or thinks that connection is still established.
Hard to advise anything as code review is required.
The difference could be:
For each TCP connection there must be general software timeout while socket is allowed to be connected or in transient state to close. If time outs, you must forcefully close the connection and reopen socket for listening.
It is a bad idea to fully rely on the W5x00 timeout mechanism for two reasons:
RE: Web server unreliable when queried from foreign country
by jameskim ·
Hi,
I think that Engeny answered you with correct information.
I guess that you tried to close the connection and FIN packet sent to the system in France but it was not delivered to it due to network problem. So the web server socket is still in SOCK_ESTABLISHED and it means there is no socket listening to the next connection request.
There are two solutions you can do.
One is to add socket closing mechanism to the web server socket in your application layer and the other is to use KEEP-ALIVE function with the web server socket. I recommend you use it with all sockets you use.
KEEP-ALIVE checks whether your socket is still valid at the lower layer than your application.
If you use KEEP-ALIVE function, the socket will be closed automatically when the relevant connection is invalid after KEEP-ALIVE Timeout.
Then, you can make a new connection with the web server.
I hope you solve this issue soon.
RE: RE: Web server unreliable when queried from foreign country
by Phono ·
Thank you for this analysis. Please give me more details.
page in 23 pieces, I mean in 23 successive IP frames, then waits 5
ms and closes the connection. Do you mean that the confirmation of
the closing from the client part may be lost, and the closing
never performed?
message, that for example must start as follows:
HTTP/1.1 200 OK
etc…
above?
RE: Web server unreliable when queried from foreign country
by Eugeny ·
For example. In general process gets broken, and socket is kept open. You must dig into your code to identify what exactly is happening, and adjust algorithm accordingly.
Do not confuse keep alive packet and keep alive HTTP header.
Keep alive in W5x00 network stack is the mechanism sending spare packet with last seq id, and expecting remote device replying with very specific content. If remote device does not reply within the timeout period or replies with RST, socket gets closed automatically with relevant flags set.
Keep alive HTTP header is the request to web server to keep TCP/HTTP connection open after it serves HTTP request for predefined period of time.