W5500 - ACK's Keep Alive when KPALVTR is 0
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: W5500 - ACK's Keep Alive when KPALVTR is 0
by Eugeny ·
There’s a known bug, or feature (up to you how you see it). Chrome opens several concurrent TCP connections to the web server, and reuses them when it needs. It does not close these connections when finished transferring data, keeping W5500 sockets allocated and not available for further connections.
Solution to this issue is changing browser you use - to Firefox. It has special setting (which Chrome was missing at the time of my investigation) network.http.max-persistent-connections-per-server. Setting it to (for example) 2 will cause Firefox opening only 2 TCP persistent connections to W5500, and you will be guaranteed having 6 remaining sockets free for other connections.
RE: RE: W5500 - ACK's Keep Alive when KPALVTR is 0
by Wizboy ·
Thanks Eugeny. That is what is happening. Strangely with Chrome “Incognito mode”, it works as expected (no extra connections) – so that is another option.
I have had some success just closing these “preemptive” sockets that Chrome opens (see below). If Chrome opens a socket but doesn’t send a GET request, I just close the socket.
RE: W5500 - ACK's Keep Alive when KPALVTR is 0
by Eugeny ·
That seem to be a workaround, but I think closing socket without notifying (through disconnect) may confuse browser and you may have some documents reported as failed to load (e.g. “X” instead of pictures on the web page). However if you do immediate disconnect, there’s a risk that Chrome will be trying to reopen the connection. Check if newer versions of Chrome are having such option as FF now.
RE: W5500 - ACK's Keep Alive when KPALVTR is 0
by Wizboy ·
Your suggestion to use disconnect instead of close work better - thanks. I see now the issue is if I disconnect if no data, sometimes Chrome displays: ERR_EMPTY_RESPONSE. What is happening is that sometimes the data (GET request) doesn’t arrive at the time the W5500 has switched to ESTABLISHED. So what I need to do is as soon as ESTABLISHED, I should wait for a period of time “just in case” Chrome wants to send some data for that socket. Have you run into something like this and if so how did you resolve it? (i.e., if you put in a wait loop, how long before the wait loop should stop waiting and then disconnect)?
Thanks!
RE: W5500 - ACK's Keep Alive when KPALVTR is 0
by Eugeny ·
Yes, and that’s why I know about this issue. I also experienced this “ERR_EMPTY_RESPONSE” issues and empty pictures on the web page, stuck sockets for a while (Chrome can keep sockets connected for minutes without activity).
I did not find satisfactory workaround for Chrome, and decided to use Firefox as people in Chrome support confirmed that Chrome does not have an option to limit number of concurrent connections.
It may be that waiting for 5 seconds would be enough, but who knows how Chrome operates and that you do not get ERR_EMPTY_RESPONSE in most interesting moment.
RE: W5500 - ACK's Keep Alive when KPALVTR is 0
by Wizboy ·
After some searching in the Chrome bug logs, I did find a work around for this “feature” for Chrome users who need it. Turn off the “Use a prediction service to load pages more quickly” option in Advanced Settings. Chrome calls this feature “preconnect”. My earlier discovery of a different behavior in Incognito mode is due to a bug in Chrome. So…hard to tell now which one is the bug and which one is the feature!!
EDIT: Eugeny is correct in that there isn’t a way (as of version 61) to disable preconnect from the server. This has to be switched off in the individual browser settings.