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/Endpoint/index.html

Module Net.EndpointSource

Network endpoints.

Endpoints

Sourcetype t = [
  1. | `Host of string * int
    (*

    Hostname and port.

    *)
  2. | `Sockaddr of Unix.sockaddr
    (*

    Direct socket address.

    *)
  3. | `Fd of Unix.file_descr
    (*

    Direct file descriptor.

    *)
]

The type for network endpoints.

Sourceval of_string : default_port:int -> string -> (t, string) result

of_string ~default_port s parses a socket endpoint specification from s.

The format is ADDR[:PORT] or PATH for a Unix domain socket (detected by the the presence of a directory separator). default_port port is used if no PORT is specified.

Sourceval with_port_of_sockaddr : Unix.sockaddr -> t -> t

with_port_of_sockaddr addr ep makes ep's port coincide with the port of addr iff both have a port. Otherwise this is ep itself. Mostly useful to adjust an endpoint whose port number was specified as 0 in order to get the one allocated by bind(2).

Formatting

Sourceval pp : Format.formatter -> t -> unit

pp formats endpoints for inspection.