Corrected TCPServer reporting as per review comments

pull/8592/head
deepikabhavnani 2018-11-20 07:37:57 -06:00
parent 068f2d14c0
commit fa6b3d2783
1 changed files with 2 additions and 2 deletions

View File

@ -53,8 +53,8 @@ nsapi_error_t TCPServer::accept(TCPSocket *connection, SocketAddress *address)
connection->_socket = socket;
connection->_event = Callback<void()>(connection, &TCPSocket::event);
_stack->socket_attach(socket, &Callback<void()>::thunk, &connection->_event);
_socket_stats.stats_update_peer(this, *address);
_socket_stats.stats_update_socket_state(this, SOCK_OPEN);
_socket_stats.stats_update_peer(connection, *address);
_socket_stats.stats_update_socket_state(connection, SOCK_CONNECTED);
connection->_lock.unlock();
break;
} else if ((_timeout == 0) || (ret != NSAPI_ERROR_WOULD_BLOCK)) {