-
Notifications
You must be signed in to change notification settings - Fork 25
Add support for TCP server APIs #27
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
Comments
I could live with either, but i think it would make sense to get this in before #28, to get some sort of unification of TCP & UDP? |
That's a tough call. While having a separate Core trait is more conceptually "pure", it does come at the cost of additional complexity. I'm leaning towards having only two traits. The UDP traits have the same issue, where the Server necessarily implements a |
I've been leaning towards @jonahd-g's assessment as well here and opting for the client-server traits as a way to mirror the UDP implementations. |
Uh oh!
There was an error while loading. Please reload this page.
Currently, there is no means to expose a TCP server via the
embedded-nal
. For example, there is no means tolisten()
orbind()
to a specific port or toaccept()
connections from clients.Server operations are added for UDP in #21, but that PR does not address the TCP stack.
One approach would be to refactor TCP similar to UDP:
This approach would work, but the downside is that the TCP server would be forced to implement the
connect()
function even when it may never be used by the server.An alternative approach would be:
The downside of approach number 1 is that users may have to implement
connect()
for a TCP server when it is never used. The downside for approach number 2 is that users will have to implement 2 traits for a client or a server.I'm curious to hear @jonahd-g and @MathiasKoch 's opinions on this one
The text was updated successfully, but these errors were encountered: