Skip to content

Commit 4f731e6

Browse files
author
Colin Hogben
committed
network-socket: Re-order args of NetworkStack::accept
Make the argument order more sensible, in line with nsapi.
1 parent 36bf482 commit 4f731e6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

features/net/network-socket/NetworkStack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class NetworkStackWrapper : public NetworkStack
159159
return _stack_api()->socket_connect(_stack(), socket, address.get_addr(), address.get_port());
160160
}
161161

162-
virtual int socket_accept(nsapi_socket_t *socket, nsapi_socket_t server, SocketAddress *address)
162+
virtual int socket_accept(nsapi_socket_t server, nsapi_socket_t *socket, SocketAddress *address)
163163
{
164164
if (!_stack_api()->socket_accept) {
165165
return NSAPI_ERROR_UNSUPPORTED;

features/net/network-socket/NetworkStack.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ class NetworkStack
160160
* This call is non-blocking. If accept would block,
161161
* NSAPI_ERROR_WOULD_BLOCK is returned immediately.
162162
*
163-
* @param handle Destination for a handle to the newly created socket
164163
* @param server Socket handle to server to accept from
164+
* @param handle Destination for a handle to the newly created socket
165165
* @param address Destination for the remote address or NULL
166166
* @return 0 on success, negative error code on failure
167167
*/
168-
virtual int socket_accept(nsapi_socket_t *handle, nsapi_socket_t server, SocketAddress *address=0) = 0;
168+
virtual int socket_accept(nsapi_socket_t server, nsapi_socket_t *handle, SocketAddress *address=0) = 0;
169169

170170
/** Send data over a TCP socket
171171
*

features/net/network-socket/TCPServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int TCPServer::accept(TCPSocket *connection, SocketAddress *address)
6060

6161
_pending = 0;
6262
void *socket;
63-
ret = _stack->socket_accept(&socket, _socket, address);
63+
ret = _stack->socket_accept(_socket, &socket, address);
6464

6565
if (0 == ret) {
6666
connection->_lock.lock();

0 commit comments

Comments
 (0)