File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,22 @@ void EthernetServer::begin(uint16_t port)
46
46
begin ();
47
47
}
48
48
49
+ void EthernetServer::end (void )
50
+ {
51
+ /* Free client */
52
+ for (int n = 0 ; n < MAX_CLIENT; n++) {
53
+ if (_tcp_client[n] != NULL ) {
54
+ EthernetClient client (_tcp_client[n]);
55
+ client.stop ();
56
+ _tcp_client[n] = NULL ;
57
+ }
58
+ }
59
+ if (_tcp_server.pcb != NULL ) {
60
+ tcp_close (_tcp_server.pcb );
61
+ _tcp_server.pcb = NULL ;
62
+ }
63
+ }
64
+
49
65
void EthernetServer::accept ()
50
66
{
51
67
/* Free client if disconnected */
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class EthernetServer :
18
18
EthernetClient available ();
19
19
virtual void begin ();
20
20
virtual void begin (uint16_t port);
21
+ void end (void );
21
22
virtual size_t write (uint8_t );
22
23
virtual size_t write (const uint8_t *buf, size_t size);
23
24
virtual operator bool ();
You can’t perform that action at this time.
0 commit comments