-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add preliminary support for the OTP socket interface #757
Conversation
1b7f7ae
to
32962aa
Compare
704db5f
to
db1f7f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say it's ok to not do non-blocking sockets for a first version of this good work, but we need socket:shutdown/2
as socket:close/1
semantics are misleading.
db1f7f2
to
da6ca88
Compare
75a4d79
to
0e807ca
Compare
059ee51
to
3fdf221
Compare
ddae90d
to
13514ab
Compare
67a938b
to
a45aa10
Compare
a525145
to
3b219be
Compare
956f50e
to
82873dd
Compare
82873dd
to
2f74f64
Compare
This PR adds preliminary support for the OTP socket interface, which exposes APIs for low-level socket operations, as defined in OTP 22 and later. This implementation aims to be API-compatible with the OTP implementation, though many parts of the interface have yet to be implemented. Key features of this implementation include the following: * A new socket driver has been added, which uses the BSD socket interface to implement the OTP socket driver * This driver is supported on generic UNIX and ESP32 platforms. Where possible, a common codebase is used, to minimize the cost of maintenance. The following operations are supported: * socket:open/3 * socket:close/1 * socket:bind/2 * socket:listen/1,2 * socket:accept/1 * socket:sockname/1 * socket:peername/1 * socket:recv/1 * socket:recvfrom/1 * socket:send/2 * socket:sendto/3 * socket:setopt/3 * socket:connect/2 * socket:shutdown/2 Currently, the TCP and UDP protocols is supported. Additional work is needed to support other data types and protocols, as well as name resolution via the OTP net:addrinfo interface. Signed-off-by: Fred Dushin <fred@dushin.net>
2f74f64
to
8e2d42f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spotted a couple typos, and a missing edoc parm.
Edit:
Disregard. I forgot to publish my comments earlier, they are outdated, and seem to be fixed.
This PR adds preliminary support for the OTP socket interface, which exposes APIs for low-level socket operations, as defined in OTP 22 and later. This implementation aims to be API-compatible with the OTP implementation, though many parts of the interface have yet to be implemented.
Key features of this implementation include the following:
The following operations are supported:
Currently, the TCP and UDP protocols is supported. Additional work is needed to support other data types and protocols, as well as name resolution via the OTP net:addrinfo interface.
These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).
SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later