Module Tcp.Where_to_listen
A Where_to_listen
describes the socket that a tcp server should listen on.
type ('address, 'listening_on) t
constraint 'address = [< Async_unix__.Unix_syscalls.Socket.Address.t ]
val sexp_of_t : ('address -> Ppx_sexp_conv_lib.Sexp.t) -> ('listening_on -> Ppx_sexp_conv_lib.Sexp.t) -> ('address, 'listening_on) t -> Ppx_sexp_conv_lib.Sexp.t
type inet
= (Async_unix__.Unix_syscalls.Socket.Address.Inet.t, int) t
val sexp_of_inet : inet -> Ppx_sexp_conv_lib.Sexp.t
type unix
= (Async_unix__.Unix_syscalls.Socket.Address.Unix.t, string) t
val sexp_of_unix : unix -> Ppx_sexp_conv_lib.Sexp.t
val create : socket_type:'address Async_unix__.Unix_syscalls.Socket.Type.t -> address:'address -> listening_on:('address -> 'listening_on) -> ('address, 'listening_on) t
val address : ('address, _) t -> 'address
val bind_to : Bind_to_address.t -> Bind_to_port.t -> inet
Listen on the specified port on the specified addresses.
val of_port : int -> inet
of_port port
isbind_to All_addresses (On_port port)
.
val of_port_chosen_by_os : inet
of_port_chosen_by_os port
isbind_to All_addresses On_port_chosen_by_os
.
val of_file : string -> unix
Listen on a unix domain socket using the specified path.