mirror of https://github.com/ARMmbed/mbed-os.git
network-socket: Re-order args of NetworkStack::accept
Make the argument order more sensible, in line with nsapi.pull/2434/head
parent
36bf4827c7
commit
4f731e6b17
|
@ -159,7 +159,7 @@ protected:
|
||||||
return _stack_api()->socket_connect(_stack(), socket, address.get_addr(), address.get_port());
|
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) {
|
if (!_stack_api()->socket_accept) {
|
||||||
return NSAPI_ERROR_UNSUPPORTED;
|
return NSAPI_ERROR_UNSUPPORTED;
|
||||||
|
|
|
@ -160,12 +160,12 @@ protected:
|
||||||
* This call is non-blocking. If accept would block,
|
* This call is non-blocking. If accept would block,
|
||||||
* NSAPI_ERROR_WOULD_BLOCK is returned immediately.
|
* 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 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
|
* @param address Destination for the remote address or NULL
|
||||||
* @return 0 on success, negative error code on failure
|
* @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
|
/** Send data over a TCP socket
|
||||||
*
|
*
|
||||||
|
|
|
@ -60,7 +60,7 @@ int TCPServer::accept(TCPSocket *connection, SocketAddress *address)
|
||||||
|
|
||||||
_pending = 0;
|
_pending = 0;
|
||||||
void *socket;
|
void *socket;
|
||||||
ret = _stack->socket_accept(&socket, _socket, address);
|
ret = _stack->socket_accept(_socket, &socket, address);
|
||||||
|
|
||||||
if (0 == ret) {
|
if (0 == ret) {
|
||||||
connection->_lock.lock();
|
connection->_lock.lock();
|
||||||
|
|
Loading…
Reference in New Issue