| 144 | } |
| 145 | |
| 146 | uint8_t EthernetClient::connected() { |
| 147 | if (_sock == MAX_SOCK_NUM) return 0; |
| 148 | |
| 149 | uint8_t s = status(); |
| 150 | return !(s == SnSR::LISTEN || s == SnSR::CLOSED || s == SnSR::FIN_WAIT || |
| 151 | (s == SnSR::CLOSE_WAIT && !available())); |
| 152 | } |
| 153 | |
| 154 | uint8_t EthernetClient::status() { |
| 155 | if (_sock == MAX_SOCK_NUM) return SnSR::CLOSED; |