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

conn: make conn_*_sendto require a conn object #4630

Closed
wants to merge 3 commits into from

Conversation

miri64
Copy link
Member

@miri64 miri64 commented Jan 12, 2016

Though GNRC (and afaik @kaspar030's stack to) are perfectly capable to send connection-less transport data without a connection most other stack APIs don't. While opening a connection object in sendto could be an alternative (though to me this defies the lightweight aspect of conn), stack internal checks make it impossible to send from a port where already a connection is open. To demonstrate the problem, here is a little echo server, that fails for both lwIP and emb6 due to this API incompatibility:

conn_udp_t conn;
conn_udp_create(&conn, s_addr, s_addr_len, AF_INET6, s_port);
conn_udp_recvfrom(&conn, data, &len, c_addr, c_addr_len, c_port);
/* following call fails for both lwIP and emb6, since there is
 * already a connection on `s_port` open and their APIs require
 * opening a connection and port was already bound above. */
conn_udp_sendto(data, len, s_addr, s_addr_len, c_addr, c_addr_len,
                AF_INET6, s_port, c_port);

Partly related #4474.

@miri64 miri64 added Area: network Area: Networking Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. labels Jan 12, 2016
@miri64 miri64 added this to the Release 2016.07 milestone Mar 29, 2016
@miri64
Copy link
Member Author

miri64 commented Jun 8, 2016

Closed in favor for #5533.

@miri64 miri64 closed this Jun 8, 2016
@miri64 miri64 deleted the conn/enh/sendto branch November 2, 2016 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants