AtomVM icon indicating copy to clipboard operation
AtomVM copied to clipboard

Add support for the OTP socket interface

Open fadushin opened this issue 3 years ago • 0 comments

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/1
    • close/1
    • bind/2
    • listen/1,2
    • accept/1
    • sockname/1
    • peername
    • recv/1
    • send/2
    • setopt/3
    • connect/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

fadushin avatar Jul 24 '22 16:07 fadushin