cross platform socket interface (#857)

* lib/std/net: add Network, Socket and Listener

Signed-off-by: Pierre Curto <pierre.curto@gmail.com>

* lib/std/net: add SocketOption

Signed-off-by: Pierre Curto <pierre.curto@gmail.com>

* lib/std/net: fixes for win32 and wasm

Signed-off-by: Pierre Curto <pierre.curto@gmail.com>

---------

Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
Pierre Curto
2023-07-16 14:14:36 +02:00
committed by GitHub
parent 11eb187fee
commit 89e084938f
9 changed files with 228 additions and 16 deletions

View File

@@ -9,4 +9,11 @@ const int PLATFORM_AF_BRIDGE = 7;
const int PLATFORM_AF_AAL5 = 8;
const int PLATFORM_AF_X25 = 9;
const PLATFORM_O_NONBLOCK = 0o4000;
const PLATFORM_O_NONBLOCK = 0o4000;
// https://git.sr.ht/~sircmpwn/hare/tree/master/item/rt/+linux/socket.ha
const int SOL_SOCKET = 1;
const int SO_REUSEADDR = 2;
const int SO_BROADCAST = 6;
const int SO_KEEPALIVE = 9;
const int SO_REUSEPORT = 15;