-
Notifications
You must be signed in to change notification settings - Fork 3k
Implement Socket::getpeername() API #8651
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
Conversation
@kjbracey-arm and @ARMmbed/mbed-os-ipcore Please review. |
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.
Sweet
/morph build |
Build : FAILUREBuild number : 3590 |
if (!_remote_peer) { | ||
return NSAPI_ERROR_NO_CONNECTION; | ||
} | ||
*address = _remote_peer; |
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.
Does this function need a return value?
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.
Yes, thank you.
This is equivalent of POSIX getpeername() function. It allows to get remote address associated with the socket. For example: socket *s = server.accept(); SocketAddress remote; s->getpeername(&remote);
b8c59cb
to
619bcb5
Compare
Build error fixed and added a unit test for |
/morph build |
Build : SUCCESSBuild number : 3610 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 3214 |
Test : FAILUREBuild number : 3386 |
Note: This PR is now a part of a rollup PR (#8733). In order to expidite remaining CI testing, this PR has been bundled into the above rollup PR. No further work is needed here, as once that PR is merged, this PR will also be closed and marked as merged. If any more commits are made in this PR, this PR will remain open and have to go through CI on its own. |
Description
This is equivalent of POSIX getpeername() function. It allows to
get remote address associated with the socket.
For example:
This is a new API so should go out on 5.11, and not in 5.10 patch releases.
NOTE: This PR replaces the change proposed in #8565
Pull request type