1#include <cx/net/socket.cxh>
2#include <cx/platform/wasm.h>
4// Named NetSocketPosix, not NetSocketWasm, matching the precedent already set by
5// wasm_thread_threadobj.cxh's UnixThread: Emscripten's socket emulation is close enough to POSIX
6// (and this platform is never compiled alongside cx/platform/unix/, so there is no name collision)
7// that it is simpler to keep the same class name than invent a distinct one for what is otherwise
10// send() is a concrete method on the base NetSocket now (its logic is platform-independent; only
11// the syscall lives behind a shim), so this class does not override it -- bind/listen still do,
12// because they touch sockaddr directly.
13class NetSocketPosix extends NetSocket
19 [canfail] factory create(NetSocketType type);
20 factory wrap(int fd, NetSocketType type, NetSocketState state);