Sockets Domain
The Sockets domain exposes low-level TCP/UDP sockets for custom protocols and long-lived connections.
aivi
use aivi.net.socketsTypes
aivi
type Address = { host: Text, port: Int }
type SocketError = { message: Text }TCP
| Function | Explanation |
|---|---|
listen address | Creates a TCP listener bound to address. |
accept listener | Waits for and returns an incoming TCP connection. |
connect address | Opens a TCP connection to address. |
send connection bytes | Sends raw bytes to the remote endpoint. |
recv connection | Receives raw bytes from the remote endpoint. |
close connection | Closes the TCP connection. |