package lo

  1. Overview
  2. Docs

Module Lo.ServerSource

Operations for creating servers.

Sourcetype t

A server.

Sourceexception Stopped

Raised when an operation is performed on a stopped server.

Sourceval create : int -> (string -> Message.data array -> unit) -> t

Create a server listening on given port with handler function taking as argument the path and messages received.

Sourceval recv : t -> unit

Receive messages and pass them to the handler. This function is blocking until a message is received.

Sourceval stop : t -> unit

Stop the server. No operation on this server should be performed afterward (otherwise, the exception Stopped is raised).