WiFi shield multiple connections demultiplexing issue

Hi everyone,

I've been trying to use the Arduino WiFi shield for building a web server, but I ran into the following issue, while debugging my code. It seems that the client connections are not properly handled by the WiFi library. When I open two tcp connections to the server at the same time, there is no way to know what data comes from which connection using the provided API. More precise, data comes in from both sessions as if they were coming from the same session and when I send data out through the WiFi shield, the session that was first open receives the data.

To reproduce this, I have set up the following scenario.

  1. Upload the WiFiWebServer example sketch to the board and open the serial console in order to see the debug messages.
  2. Using telnet (or another tool), connect to the Arduino on port 80 (SESSION1).

telnet xxx.xxx.xxx.xxx 80

  1. Open one more telnet session, on port 80 (SESSION2).
  2. In SESSION2, type an HTTP request (e.g. "GET / HTTP/1.1" without quotes; press ENTER twice to send an additional blank line, marking the end of the request).

The problem is that the server (Arduino) will send the response to SESSION1, even though the request is made in SESSION2. I suspect that there is a problem in the WiFi library, but I couldn't find it.

Has anyone else encountered this issue? Is there a workaround for this?
I've looked through the forums and there seem to be many issues with the WiFi shield.

Thanks a lot!

I suspect that there is a problem in the WiFi library, but I couldn't find it.

There is. Surfer Tim found the same issue, and reported it to the Arduino team.

Has anyone else encountered this issue?

Yes.

Is there a workaround for this?

An ethernet shield.

I've looked through the forums and there seem to be many issues with the WiFi shield.

Yep. That's why Surfer Tim has mine. He's got a far better understanding of the issues involved than I do.

Thank you, Paul.
Is there a way to track this issue? I looked through SurferTim's topics and posts but couldn't locate a thread concerning this.

I can't find my issues that I posted at google.com or github. It appears the wifi shield has been orphaned by the Arduino team.

claudium0:
...
Is there a workaround for this?
...

The Arduino Yun/Yun Shield has build in web server uHTTPd supports multiple concurrent requests.

# Maximum number of concurrent requests.
# If this number is exceeded, further requests are
# queued until the number of running requests drops
# below the limit again.
option max_requests 3

# Maximum number of concurrent connections.
# If this number is exceeded, further TCP connection
# attempts are queued until the number of active
# connections drops below the limit again.
option max_connections 100