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

Usage of socket connect operations is non-intuitive #10

Closed
ryan-summers opened this issue Aug 26, 2020 · 1 comment
Closed

Usage of socket connect operations is non-intuitive #10

ryan-summers opened this issue Aug 26, 2020 · 1 comment
Assignees

Comments

@ryan-summers
Copy link
Member

Because of the embedded-nal, it is not possible to determine if a socket is currently in the "connecting" state. Some network stacks (such as the W5500) can perform the connection asynchronously, so it is possible for the call to block until the connection completes.

However, other network stacks (such as smoltcp) require processing the network stack within the application to further the TCP connection state. This makes it impossible for the connect() calls to block in these stacks.

To facilitate this, minimq currently continually calls connect() on the same socket until it is fully connected. This can have unintended effects if the network stack implementation has an intermediate "connecting" state that is corrupted by the duplicated connect() call.

We should standardize:

  1. Add an is_connecting() API to the embedded-nal
  2. Enforce that network stacks allow extraneous calls of connect() whenever the socket is not in a connected state.
@ryan-summers
Copy link
Member Author

Closing this as resolved. We handle this via an updated state machine. This is an issue with the embedded-nal and not minim.

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

No branches or pull requests

1 participant