AtomVM
AtomVM copied to clipboard
Add support for the OTP socket interface
This PR adds limited 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 interfaces
- This driver is supported on generic UNIX and ESP32 platforms. Where possible, a common codebase is used, to minimize the cost of maintenance.
- Currently, the driver support a core set of operations to support TCP connections, including:
socket:open/1close/1bind/2listen/1,2accept/1sockname/1peernamerecv/1send/2setopt/3connect/2
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