arduino Server with 2 clients + Ethernet Shield.

I need some help.

my problem is , i need to control 3 arduinos UNO with Ethernet Shield Wiznet W5100.
one is the server and the others are the clients. I achieve activate the outputs of the clients, with the server. but I want activate all outputs with any client .

There is a bug in the Ethernet library that does not track incoming socket connections. If you try to write a server that listens for more than one connection, all incoming traffic goes to the first connection. I ran in to this last year and hacked the library so I could have multiple connections:

http://subethasoftware.com/2013/04/09/arduino-ethernet-and-multiple-socket-server-connections/

I have not had time to polish my hack, but this may explain the problem so you can work around the limitation.

thanks!!! for the information but it is posible.

There is a bug in the Ethernet library that does not track incoming socket connections. If you try to write a server that listens for more than one connection, all incoming traffic goes to the first connection

That is not true. The ethernet shield and library track incoming connections great.

It is possible. I have tested my server code with three clients and couldn't crash it. The server code only services one connection at a time, so you must keep the client requests and the server responses short.

edit: If you are talking about persistent connections of two clients simultaneously, that is more difficult, but I tested that scenario and it works ok. But in that case, I gave up on the persistent tcp connections and went with udp.

hey sufferTime.....

UDP??? mmm.

is a protocol or what . sorry but im a noob.
whit this conexion is posible, connect more clients?

UDP has become my favorite data transfer protocol. It is fast and, if used correctly, very reliable. The number of clients depends on your programming skills.

Here is a thread that has some of my UDP code. You don't need to be that complex. It is designed to communicate with two UDP "servers".
http://forum.arduino.cc/index.php?topic=223544.0

SurferTim:

There is a bug in the Ethernet library that does not track incoming socket connections. If you try to write a server that listens for more than one connection, all incoming traffic goes to the first connection

That is not true. The ethernet shield and library track incoming connections great.

It is possible. I have tested my server code with three clients and couldn't crash it. The server code only services one connection at a time, so you must keep the client requests and the server responses short.

edit: If you are talking about persistent connections of two clients simultaneously, that is more difficult, but I tested that scenario and it works ok. But in that case, I gave up on the persistent tcp connections and went with udp.

I am glad this has been fixed. It was not possible in the version I worked with a year ago. The code never stored the port, so any packed coming in to that IP would go to whatever connection was there. I wrote simple test programs working through the process and was able to make modifications to the library so it works and could listen to multiple connections at the same time and interact with them.

What version are you running? I probably should check the 1.5 beta stuff because it was a pretty big oversight/bug.