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