-
Effekt Library
- io/network
- Connection
- read
- write
- connect
- close
- Listener
- bind
- listen
- shutdown
- streaming
- internal
- connect
- read
- write
- close
- bind
- listen
- shutdown
- io/network Jump to source: libraries/common/io/network.effekt
- Connection
- read
(handle: Connection, buffer: ByteArray, offset: Int, size: Int): Int / {Exception[IOError]} - write
(handle: Connection, buffer: ByteArray, offset: Int, size: Int): Int / {Exception[IOError]} - connect
(host: String, port: Int): Connection / {Exception[IOError]} - close
(handle: Connection): Unit / {} - Listener
- bind
(host: String, port: Int): Listener / {Exception[IOError]} - listen
(listener: Listener, handler: (Connection) => Unit at {io,async,global}): Unit / {Exception[IOError]} - shutdown
(listener: Listener): Unit / {} - streaming
[R] (connection: Connection) { program: => R / {read[ByteArray], emit[ByteArray]} }: R / {Exception[IOError]} - internal
- connect
(host: String, port: Int): Int / {} - read
(handle: Int, buffer: ByteArray, offset: Int, size: Int): Int / {} - write
(handle: Int, buffer: ByteArray, offset: Int, size: Int): Int / {} - close
(handle: Int): Unit / {} - bind
(host: String, port: Int): Int / {} - listen
(listener: Int, handler: (Int) => Unit at {io,async,global}): Int / {} - shutdown
(handle: Int): Unit / {}
Example usage: examples/stdlib/io/network
A TCP handle. Should not be inspected.
Reads data from a TCP connection into a buffer at the given offset.
Writes data from a buffer at the given offset to a TCP connection.
Establishes a TCP connection to the specified host and port.
Closes a TCP connection and releases associated resources.
A TCP listener. Should not be inspected.
Creates a TCP listener bound to the specified host and port.
Starts listening for incoming connections and handles them with the provided handler function. Runs until `shutdown` is called on this `Listener`.
Stops a TCP listener and releases associated resources.