wire.bend fails
raw source on the hub · import 0xf33f70afa849b331f76f524b6d1629ec/wire.bend as Wire
1 import
import Base
Definitions
def listen source · line 35 · raw
@port:U32 -> IO(Result<&1, &1, Pair(U32, String), Listener>)
def accept source · line 38 · raw
@l:Listener -> IO(Pair(Listener, Result<&1, &1, Pair(U32, String), Socket>))
def connect source · line 41 · raw
@host:String -> @port:U32 -> IO(Result<&1, &1, Pair(U32, String), Socket>)
def close source · line 44 · raw
@sock:Socket -> IO(Unit)
Effects (foreign code)
effect wire_recv source · line 18 · raw
@sock:Socket -> @max:U32 -> IO(Pair(Socket, Result<&1, &1, Pair(U32, String), List<&2, U32>>))
up to max bytes, once some arrive; [] when the peer has closed
foreign: effs/wire.c, effs/wire.js
effect wire_recv_timeout source · line 24 · raw
@sock:Socket -> @max:U32 -> @ms:U32 -> IO(Pair(Socket, Result<&1, &1, Pair(U32, String), Maybe<&1, List<&2, U32>>>))
as wire_recv, but None{} when nothing arrives within ms milliseconds
foreign: effs/wire.c, effs/wire.js
effect wire_send source · line 30 · raw
@sock:Socket -> @data:List<&2, U32> -> IO(Pair(Socket, Result<&1, &1, Pair(U32, String), Unit>))
every byte; a value past 255 fails with EINVAL before any is sent
foreign: effs/wire.c, effs/wire.js