Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: TcpServer.cpp
- Revision:
- 13:95c00132cd98
- Parent:
- 11:647d53d146f1
--- a/TcpServer.cpp Fri Aug 30 19:15:42 2019 +0000
+++ b/TcpServer.cpp Sat Aug 31 20:34:52 2019 +0000
@@ -40,6 +40,8 @@
*/
TcpClient* TcpServer::accept()
{
+ TcpClient* result = NULL;
+
UipEthernet::ethernet->tick();
for (uip_userdata_t * data = &TcpClient::all_data[0]; data < &TcpClient::all_data[_conns]; data++) {
if
@@ -52,11 +54,13 @@
) {
data->ripaddr[0] = uip_conns[data->state & UIP_CLIENT_SOCKETS].ripaddr[0];
data->ripaddr[1] = uip_conns[data->state & UIP_CLIENT_SOCKETS].ripaddr[1];
- return(new TcpClient(data));
+ result = new TcpClient(data);
+ result->setInstance(result);
+ return result;
}
}
- return NULL;
+ return result;
}
/**