Pages: [1]   Go Down
Author Topic: Concurrent Clients - Session State  (Read 415 times)
0 Members and 1 Guest are viewing this topic.
Everett, WA
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have started using the Ethernet library. I am still in the process of understanding its implementation.

How are connected clients serialized? If 2 clients are connected at the same time, how do I know which one I am communicating with?
When a client connects and submits a form, I want to make sure that I can isolate the communication between the server and client without interference of another client.

Depending on the implementation of the Ethernet library, I would either want to handle clients in serial or parallel (if possible).
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8653
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Generally a web server will provide session memory by placing a cookie on the web browser.  That cookie will be returned with each web request.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

While multiple clients can connect to the Arduino-as-server at one time, only one is processed on any given pass through loop. The entire transaction with that client is completed on that pass through loop. So, there is never any ambiguity about which client you are dealing with.

Client/server communication is stateless. The server has no clue, unless the client takes action, that it has ever seen a client before. Having the client send some kind of ID to the server, so the server can say "Hey, I've seen you before" is possible, but not really a good idea (on the Arduino). It is better to treat each client as a new, never before seen, client.
Logged

Everett, WA
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot for the responses!
Logged

Pages: [1]   Go Up
Jump to: