diff --git a/features/net/network-socket/NetworkStack.cpp b/features/net/network-socket/NetworkStack.cpp index 1951566f93..2198507d9e 100644 --- a/features/net/network-socket/NetworkStack.cpp +++ b/features/net/network-socket/NetworkStack.cpp @@ -159,7 +159,7 @@ protected: return _stack_api()->socket_connect(_stack(), socket, address.get_addr(), address.get_port()); } - virtual int socket_accept(nsapi_socket_t *socket, nsapi_socket_t server, SocketAddress *address) + virtual int socket_accept(nsapi_socket_t server, nsapi_socket_t *socket, SocketAddress *address) { if (!_stack_api()->socket_accept) { return NSAPI_ERROR_UNSUPPORTED; diff --git a/features/net/network-socket/NetworkStack.h b/features/net/network-socket/NetworkStack.h index d948e6f9ba..aff3541c6f 100644 --- a/features/net/network-socket/NetworkStack.h +++ b/features/net/network-socket/NetworkStack.h @@ -160,12 +160,12 @@ protected: * This call is non-blocking. If accept would block, * NSAPI_ERROR_WOULD_BLOCK is returned immediately. * - * @param handle Destination for a handle to the newly created socket * @param server Socket handle to server to accept from + * @param handle Destination for a handle to the newly created socket * @param address Destination for the remote address or NULL * @return 0 on success, negative error code on failure */ - virtual int socket_accept(nsapi_socket_t *handle, nsapi_socket_t server, SocketAddress *address=0) = 0; + virtual int socket_accept(nsapi_socket_t server, nsapi_socket_t *handle, SocketAddress *address=0) = 0; /** Send data over a TCP socket * diff --git a/features/net/network-socket/TCPServer.cpp b/features/net/network-socket/TCPServer.cpp index 78ef775a9e..a56372032f 100644 --- a/features/net/network-socket/TCPServer.cpp +++ b/features/net/network-socket/TCPServer.cpp @@ -60,7 +60,7 @@ int TCPServer::accept(TCPSocket *connection, SocketAddress *address) _pending = 0; void *socket; - ret = _stack->socket_accept(&socket, _socket, address); + ret = _stack->socket_accept(_socket, &socket, address); if (0 == ret) { connection->_lock.lock();