package b0

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Socket.EndpointSource

Endpoints.

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

    Hostname and port.

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

    Given socket address.

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

    Direct file descriptor.

    *)
]

The type for specifying a socket endpoint to connect or to listen to on.

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 pp : Format.formatter -> t -> unit

pp formats endpoints.

Sourceval wait_connectable : ?socket_type:Unix.socket_type -> timeout:Mtime.Span.t -> t -> ([ `Ready | `Timeout ], string) result

wait_connectable ~timeout ep st blocks until fd becomes connectable or duration timeout elapses.

socket_type defines the kind of socket, it defaults to Unix.socket_type.SOCK_STREAM.

Sourceval wait_connectable' : ?socket_type:Unix.socket_type -> timeout:Mtime.Span.t -> t -> (unit, string) result

wait_connectable' is like wait_connectable but errors with a message on timeout.