-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sock_tcp: Add missing function and doc #5923
Conversation
9456d5a
to
94b3031
Compare
Rebased to master and adapted for #5929 (also added timeout to |
94b3031
to
fc67664
Compare
* | ||
* @note Function may block. | ||
* | ||
* @return The number of bytes read on success. | ||
* @return 0, if no read data is available, but everything is in order. | ||
* @return -EADDRNOTAVAIL, if local of @p sock is not given. |
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.
Anyone remember why we introduced that? Since a sock
can properly only be initialized via sock_tcp_connect()
and sock_tcp_listen()
they only can't have a local end point, if they are not connected (i.e. not initialized), so this result would be the same case as -ENOTCONN
. @kaspar030 @brummer-simon?
* puts("Error creating listening queue"); | ||
* return 1; | ||
* } | ||
* puts("Accepting on port 12345"); |
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.
"listening" ?
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.
well in l. 49 below it starts accepting...
* } | ||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
* | ||
* In the case of we somehow manage to break the indefinite accepting loop we |
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.
infinite
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.
UDP and IP doc say indefinite in a similar case.
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.
Ah sorry, thought it was a different line ^^"
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.
The simple TCP echo example is nice. I just have 2 minor comments.
Addressed comments. |
aecf754
to
6e2f1c5
Compare
Squashed |
And Go ! |
Provides detailed examples for
sock_tcp
and fixes for the documentation. Also, there wasn't any function to get the local end point of a listening queue yet, but this adds it.