File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ void WiFiServer::begin ()
9999 exit (EXIT_FAILURE);
100100 }
101101
102- server.sin_family = AF_INET;
102+ server.sin_family = AF_INET;
103103 server.sin_port = htons (mockport);
104104 server.sin_addr .s_addr = htonl (global_source_address);
105105 if (bind (sock, (struct sockaddr *)&server, sizeof (server)) == -1 )
@@ -150,3 +150,23 @@ void WiFiServer::stop ()
150150{
151151 close ();
152152}
153+
154+ size_t WiFiServer::hasClientData ()
155+ {
156+ // Trivial Mocking:
157+ // There is no waiting list of clients in this trivial mocking code,
158+ // so the code has to act as if the tcp backlog list is full,
159+ // and nothing is known about potential further clients.
160+ // It could be implemented by accepting new clients and store their data until the current one is closed.
161+ return 0 ;
162+ }
163+
164+ bool WiFiServer::hasMaxPendingClients ()
165+ {
166+ // Mocking code does not consider the waiting client list,
167+ // so it will return ::hasClient() here meaning:
168+ // - our waiting client list does not exist
169+ // - we consider pending number is max if a new client is waiting
170+ // or not max if there's no new client.
171+ return hasClient ();
172+ }
You can’t perform that action at this time.
0 commit comments