-
Notifications
You must be signed in to change notification settings - Fork 3k
network-socket: Optionally return peer address from accept(). #2434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
36bf482
4f731e6
1929c5b
9180796
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,11 +160,12 @@ class NetworkStack | |
* 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 sockey | ||
* @param handle Destination for a handle to the newly created socket | ||
* @param server Socket handle to server to accept from | ||
* @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) = 0; | ||
virtual int socket_accept(nsapi_socket_t *handle, nsapi_socket_t server, SocketAddress *address=0) = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these parameters be reordered to match the C api's socket_accept? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, yes I think they should. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just pushed a patch to a fork from your fork as a part of looking at the other implementations: infinnovation-dev#1 Fee free to steal it, or I'll make a pr onto this branch once nanostack is updated. (not sure if there is a better way to handle this) |
||
|
||
/** Send data over a TCP socket | ||
* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, this is a better argument order. And now is the best time for the change.