-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
doc: net: Add socket service API usage documentation #87110
base: main
Are you sure you want to change the base?
doc: net: Add socket service API usage documentation #87110
Conversation
@pdgendt I think I directed you to wrong example of the socket service API. The |
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.
Thanks @jukkar for this, a nice starting point. A few minor remarks, and one "bigger" remark concerning TCP clients.
User specified callback which is called when data is received to the | ||
listening socket. | ||
|
||
Application Overview |
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 overview really only shows a "simple" UDP service, while it is more complex for TCP as it creates new socket file descriptors for connecting clients.
It would be nice to have that distinction in the documentation.
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, I thought about this, but did not want to write complete application as the echo-service
application has that implemented. But we could put something more about TCP and what to do with the accepted 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.
Yes, one thing that tricked me, and would be nice to have documented, is that the accept
call can be done in the callback too. This isn't the case in the echo-service
sample, where instead a loop is used for a single client.
In most cases, I think, services should serve multiple clients.
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.
Sure, we could enhance the echo-service sample to be a bit more realistic. Patches are welcome to enhance the sample.
The generated documentation looks like this |
Add information how to use socket service API from application point of view. Signed-off-by: Jukka Rissanen <[email protected]>
Clarify the documentation in the README.rst file. Also remove the obsolete comment from main.c as it is no longer correct. Signed-off-by: Jukka Rissanen <[email protected]>
a8d8b2a
to
aced06a
Compare
|
Add information how to use socket service API from application point of view.
Fixes #86982