jow- / ucode

JavaScript-like language with optional templating
ISC License
90 stars 30 forks source link

lib: introduce socket library #196

Closed jow- closed 5 months ago

jow- commented 5 months ago

Introduce a new socket module which provides bindings for the BSD sockets API to ucode scripts.

Example usage:

import * as socket from 'socket';

let sk = socket.create(socket.AF_INET, socket.SOCK_STREAM);
sk.connect("192.168.1.1", 80);
sk.send("GET / HTTP/1.0\r\n\r\n");
print(sk.recv(4096));
sk.close();
jow- commented 5 months ago

PR is WIP yet. The following tasks need to be done: