package affect

  1. Overview
  2. Docs
Streamlined and natural concurrency model for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

affect-0.0.0.tbz
sha512=b328f6696e60c489da8cc2e8fad0537ca6634a39fc0c5de5840d4f98561f110617ef79ba8285ee8427dd99908c6b3d39114973598cddc5ded91abcce3b91b9a6

doc/affect.tmp/Net/index.html

Module NetSource

Networking.

Warning. This interface is expected to move back to the more library, it will no longer be distributed by this library in the future.

Endpoints

Sourcemodule Endpoint : sig ... end

Network endpoints.

Connections

Sourcemodule Connection : sig ... end

Network connections.

Sourceval with_connection : ?nonblock:bool -> ?socket_type:Unix.socket_type -> peer:Endpoint.t -> (Connection.t -> 'a) -> ('a, string) result

with_connection ~peer f open a connection to peer, invokes f with the connection and makes sure it is properly closed when f returns with a value or an exception. See Connection.open' for details about the arguments.

Sourceval try_with_connection : ?nonblock:bool -> ?socket_type:Unix.socket_type -> peer:Endpoint.t -> (Connection.t -> 'a) -> ('a option, string) result

try_with_connection is like with_connection but uses Connection.try_open to open the connection.

Sourceval with_connection_close : Connection.t -> (Connection.t -> 'a) -> 'a

with_connection_close c f invokes with c and makes sure it is properly closed when f returns with a value or an exception.

Listeners

Sourcemodule Listener : sig ... end

Network connection listeners.

Sourceval with_listener : ?nonblock:bool -> ?socket_type:Unix.socket_type -> ?backlog:int -> on:Endpoint.t -> (Listener.t -> 'a) -> ('a, string) result

with_listener ~on f opens a listener on endpoint on, invokes f with the listener and makes sure it is properly closed when f returns with a value or an exception. See Listener.open' for details about the arguments.

Messaging

Sourcemodule Msg : sig ... end

Send and receive messages over stream sockets.

Formatters

Sourceval pp_sockaddr : Format.formatter -> Unix.sockaddr -> unit

pp_sock_addr formats socket addresses for inspection.

Sourceval pp_socket_type : Format.formatter -> Unix.socket_type -> unit

pp_socket_type formats socket types for inspection.