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 #3662

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

BSD Sockets API: Basic blocking API #3662

zephyrbot opened this issue Jun 1, 2017 · 11 comments
Labels
area: Networking Enhancement Changes/Updates/Additions to existing features priority: high High impact/importance bug
Milestone

Comments

@zephyrbot
Copy link
Collaborator

zephyrbot 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)

@zephyrbot
Copy link
Collaborator Author

by Paul Sokolovsky:

Patchset was submitted: #498

@zephyrbot
Copy link
Collaborator Author

by Paul Sokolovsky:

This story was implemented and merged.

@zephyrbot
Copy link
Collaborator Author

by Paul Sokolovsky:

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

@zephyrbot
Copy link
Collaborator Author

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

@zephyrbot
Copy link
Collaborator Author

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.

@zephyrbot
Copy link
Collaborator Author

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.

@zephyrbot
Copy link
Collaborator Author

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.

@zephyrbot
Copy link
Collaborator Author

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 ZEP-2227), sockets/echo_async to support both IPv4 and IPv6: #1186 . (sockets/echo stays IPv4-only, as there's no easy way to extend it anyway.)

@zephyrbot
Copy link
Collaborator Author

by Chandrakala Kempanna:

gurucharan p Please close the Jira if found working

@zephyrbot
Copy link
Collaborator Author

by gurucharan p:

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

So closing the Jira.

@zephyrbot
Copy link
Collaborator Author

zephyrbot commented Sep 1, 2017

Related to GH-3706

@zephyrbot zephyrbot added priority: high High impact/importance bug area: Networking Enhancement Changes/Updates/Additions to existing features labels Sep 23, 2017
@zephyrbot zephyrbot added this to the v1.9.0 milestone Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking Enhancement Changes/Updates/Additions to existing features priority: high High impact/importance bug
Projects
None yet
Development

No branches or pull requests

1 participant