Std.Net
25 public declarations
- accept
&Std.Net.Listener -> Result[Std.Net.Connection, Std.Net.NetError]Wait for the next connection.
- close
&Std.Net.Connection -> Result[(), Std.Net.NetError]Close a connection.
- closeListener
&Std.Net.Listener -> Result[(), Std.Net.NetError]Stop listening.
- connect
Str -> Int -> Result[Std.Net.Connection, Std.Net.NetError]Open a connection to somewhere else.
- Connection
A connection, open in both directions.
- connectWithin
Str -> Int -> Int -> Result[Std.Net.Connection, Std.Net.NetError]Open a connection, waiting no longer than the stated milliseconds.
- finish
&Std.Net.Connection -> Result[(), Std.Net.NetError]Say that nothing more will be sent, while still reading what comes back.
- foldChunks
&Std.Net.Connection -> T -> fn(T, Bytes) -> T -> Result[T, Std.Net.NetError]Combine everything a peer sends into one value, holding one chunk at a
- listen
Str -> Int -> Result[Std.Net.Listener, Std.Net.NetError]Wait for connections on a port.
- Listener
An endpoint waiting for connections.
- listenLocal
Int -> Result[Std.Net.Listener, Std.Net.NetError]Wait for connections reachable only from this machine.
- NetError
Why an operation over the network did not do what it was asked.
- peerOf
&Std.Net.Connection -> Result[Str, Std.Net.NetError]Who is at the other end.
- portOf
&Std.Net.Listener -> Result[Int, Std.Net.NetError]Which port a listener is actually on.
- receive
&Std.Net.Connection -> Int -> Result[Option[Bytes], Std.Net.NetError]The next bytes, or nothing when the other end has closed.
- receiveAll
&Std.Net.Connection -> Result[Bytes, Std.Net.NetError]Everything a peer sends until it closes, joined once rather than once per
- receiveExactly
&Std.Net.Connection -> Int -> Result[Bytes, Std.Net.NetError]Read exactly the requested count of bytes, or report that the peer closed
- receiveUntil
&Std.Net.Connection -> &Bytes -> Int -> Result[(Bytes, Bytes), Std.Net.NetError]Read until a marker has arrived, answering what came before it and what
- receiveWithin
&Std.Net.Connection -> Int -> Int -> Result[Option[Bytes], Std.Net.NetError]Read the next bytes, waiting no longer than the stated milliseconds.
- send
&Std.Net.Connection -> &Bytes -> Result[(), Std.Net.NetError]Send bytes, and keep sending until every one has gone.
- sendText
&Std.Net.Connection -> Str -> Result[(), Std.Net.NetError]Send text, as its UTF-8 encoding.
- sendTextWithin
&Std.Net.Connection -> Str -> Int -> Result[(), Std.Net.NetError]Send text, waiting no longer than the stated milliseconds.
- sendWithin
&Std.Net.Connection -> &Bytes -> Int -> Result[(), Std.Net.NetError]Send bytes, waiting no longer than the stated milliseconds.
- serve
&Std.Net.Listener -> Int -> fn(Std.Net.Connection) -> Bool -> Result[Int, Std.Net.NetError]Wait for connections, hand each to an action, and close it however the
- withConnection
Str -> Int -> fn(Std.Net.Connection) -> Result[T, Std.Net.NetError] -> Result[T, Std.Net.NetError]Open a connection, hand it to an action, and close it however the action
