| 27 | } |
| 28 | |
| 29 | void EthernetServer::accept() |
| 30 | { |
| 31 | int listening = 0; |
| 32 | |
| 33 | for (int sock = 0; sock < MAX_SOCK_NUM; sock++) { |
| 34 | EthernetClient client(sock); |
| 35 | |
| 36 | if (EthernetClass::_server_port[sock] == _port) { |
| 37 | if (client.status() == SnSR::LISTEN) { |
| 38 | listening = 1; |
| 39 | } |
| 40 | else if (client.status() == SnSR::CLOSE_WAIT && !client.available()) { |
| 41 | client.stop(); |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | if (!listening) { |
| 47 | begin(); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | EthernetClient EthernetServer::available() |
| 52 | { |