Skip to content
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

BSD Sockets API: Basic blocking API #2062

Closed
nashif opened this issue Jun 1, 2017 · 11 comments
Closed

BSD Sockets API: Basic blocking API #2062

nashif opened this issue Jun 1, 2017 · 11 comments

Comments

@nashif
Copy link

nashif commented Jun 1, 2017

Reported by Paul Sokolovsky:

"As an application developer, familiar with BSD Sockets API (part of POSIX), I would like to develop, or port existing, simple (blocking sockets mode) networking applications using this API, on Zephyr RTOS. I would like the behavior of API calls to be as close as possible to POSIX. All of UDP, TCP, IPv4, IPv6 should be supported."

API calls planned to be implemented:

  • socket()
  • close() (for sockets)
  • connect() (blocking)
  • bind()
  • listen()
  • accept() (blocking)
  • send() (blocking)
  • recv() (blocking)
  • getaddrinfo()

There should be simple client and simple server sample applications to demonstrate the functionality, similar to echo_client/echo_server samples for native API.

(Imported from Jira ZEP-2226)

@nashif
Copy link
Author

nashif commented Jun 15, 2017

by Paul Sokolovsky:

Patchset was submitted: zephyrproject-rtos/zephyr#498

@nashif
Copy link
Author

nashif commented Jun 29, 2017

by Paul Sokolovsky:

This story was implemented and merged.

@nashif
Copy link
Author

nashif commented Jun 29, 2017

by Paul Sokolovsky:

There's a test: tests/net/socket/udp/ , and a sample: samples/net/socket_echo/.

@nashif
Copy link
Author

nashif commented Aug 8, 2017

by gurucharan p:

The current sample implementation in samples/net/sockets/echo/ seems to be supported only for TCP and IPv4 and it is working fine in this. But I would like to know if we have any plans of implementing/expanding the code to further support for UDP and IPv6 too like in the sample code echo_server

Also the current sample is working fine for the first time,but failing to be connected and send and recv the packets from the 2nd time onwards on TCP socket

@nashif
Copy link
Author

nashif commented Aug 8, 2017

by Paul Sokolovsky:

The BSD Sockets subsystem supports UDP and IPv6. However, the purpose of samples/net/sockets/echo/ sample is to show simple, easy to follow sockets code which portable between POSIX (Linux) and Zephyr. So, I don't expect that particular sample to expanded.

The coverage tests (vs samples) should be expanded however, and there's a simple IPv4 UDP test in tests/net/socket/udp/. Further expansion is however blocked on inflexibility of testing system (literally, testing network functionality requires a network interface, but sanitycheck doesn't provide one), so that's the subject of future work.

@nashif
Copy link
Author

nashif commented Aug 8, 2017

by Paul Sokolovsky:

Also the current sample is working fine for the first time,but failing to be connected and send and recv the packets from the 2nd time onwards on TCP socket

Please submit a separate ticket with details of your testing environment and steps to reproduce. Thanks.

@nashif
Copy link
Author

nashif commented Aug 22, 2017

by gurucharan p:

It seems there was a problem with the application at my end.The sample application works fine for packet transfer in TCP.

@nashif
Copy link
Author

nashif commented Aug 22, 2017

by Paul Sokolovsky:

Thanks for the follow-up. I by now did quite extensive testing on qemu_x86 (SLIP), frdm_k64f (Ethernet) and 96b_carbon (6lowpan/BLE), and never saw that issue, multiple connections worked well for me.

Of the related note, I actually extended non-blocking sample (so, mostly relates to GH-2063), sockets/echo_async to support both IPv4 and IPv6: zephyrproject-rtos/zephyr#1186 . (sockets/echo stays IPv4-only, as there's no easy way to extend it anyway.)

@nashif
Copy link
Author

nashif commented Sep 1, 2017

by Chandrakala Kempanna:

gurucharan p Please close the Jira if found working

@nashif
Copy link
Author

nashif commented Sep 1, 2017

by gurucharan p:

It seems this issue has been fixed with commit ID: eb5d6fcef5969b596dc0613c8b166bf55d9203b8

So closing the Jira.

@nashif
Copy link
Author

nashif commented Sep 1, 2017

Related to ZEP-2271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant