Pages: [1]   Go Down
Author Topic: Disconnect client from Server/EthernetServer.  (Read 402 times)
0 Members and 1 Guest are viewing this topic.
Singapore
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From the docs http://arduino.cc/en/Reference/Ethernet, EthernetServer class doesn't seem to have a disconnect method for disconnecting connected clients. If there are more than 4 clients connected, EthernetServer would froze until one or two of the clients disconnect. This is a limitation of the shield:

Quote
The Arduino Ethernet Shield allows an Arduino board to connect to the internet. It is based on the Wiznet W5100 ethernet chip (datasheet). The Wiznet W5100 provides a network (IP) stack capable of both TCP and UDP. It supports up to four simultaneous socket connections. Use the Ethernet library to write sketches which connect to the internet using the shield. The ethernet shield connects to an Arduino board using long wire-wrap headers which extend through the shield. This keeps the pin layout intact and allows another shield to be stacked on top.
- http://arduino.cc/en/Main/ArduinoEthernetShield

Is there a way to disconnect clients from the EthernetServer once they're done doing their stuff?
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 115
Posts: 5367
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You should be using the client functions after the server.available() call. Take a look at my server code.
http://playground.arduino.cc/Code/WebServerST

This gets the client.
Code:
EthernetClient client = server.available();
After that, use the client calls.
Code:
client.print();
client.println();
client.write();
//and when you are finished sending packets
client.stop();
edit: client.stop() is the "disconnect".
« Last Edit: January 31, 2013, 06:45:50 am by SurferTim » Logged

Singapore
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you!

 smiley-sweat What was on my mind!?  smiley-lol
Logged

Pages: [1]   Go Up
Jump to: