Merge pull request #9079 from kegilbert/TCPSocket-accept-statelog

Add socket stat logging state change update
pull/9143/head
Martin Kojtal 2018-12-18 08:06:05 +00:00 committed by GitHub
commit 06748af2f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -288,6 +288,8 @@ TCPSocket *TCPSocket::accept(nsapi_error_t *error)
if (0 == ret) { if (0 == ret) {
connection = new TCPSocket(this, socket, address); connection = new TCPSocket(this, socket, address);
_socket_stats.stats_update_peer(connection, address);
_socket_stats.stats_update_socket_state(connection, SOCK_CONNECTED);
break; break;
} else if ((_timeout == 0) || (ret != NSAPI_ERROR_WOULD_BLOCK)) { } else if ((_timeout == 0) || (ret != NSAPI_ERROR_WOULD_BLOCK)) {
break; break;