Skip to content

Commit a12aee1

Browse files
committed
EthernetServer.end() - stop() all clients
1 parent 1459f0e commit a12aee1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/EthernetServer.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ void UIPServer::begin()
6767
void UIPServer::end() {
6868
uip_unlisten(_port);
6969
listening = false;
70+
for ( uip_userdata_t* data = &UIPClient::all_data[0]; data < &UIPClient::all_data[UIP_CONNS]; data++ )
71+
{
72+
if ((data->state & UIP_CLIENT_CONNECTED) && uip_conns[data->conn_index].lport ==_port)
73+
{
74+
UIPClient client(data);
75+
client.stop();
76+
}
77+
}
7078
}
7179

7280
UIPServer::operator bool() {

0 commit comments

Comments
 (0)