tjs:posix-socket
Provides access to most of the POSIX socket API. It can be listened to with poll (libuv poll).
NOTE: Not available on Windows.
import { PosixSocket } from 'tjs:posix-socket';
const { AF_INET, SOCK_STREAM, IPPROTO_TCP } = PosixSocket.defines;
const sock = new PosixSocket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
const addr = PosixSocket.createSockaddrIn('127.0.0.1', 8080);
sock.bind(addr);
sock.listen(128);