NetNetworking.
Warning. This interface is expected to move back to the more library, it will no longer be distributed by this library in the future.
module Endpoint : sig ... endNetwork endpoints.
module Connection : sig ... endNetwork connections.
val with_connection :
?nonblock:bool ->
?socket_type:Unix.socket_type ->
peer:Endpoint.t ->
(Connection.t -> 'a) ->
('a, string) Stdlib.resultwith_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.
val try_with_connection :
?nonblock:bool ->
?socket_type:Unix.socket_type ->
peer:Endpoint.t ->
(Connection.t -> 'a) ->
('a option, string) Stdlib.resulttry_with_connection is like with_connection but uses Connection.try_open to open the connection.
val with_connection_close : Connection.t -> (Connection.t -> 'a) -> 'awith_connection_close c f invokes with c and makes sure it is properly closed when f returns with a value or an exception.
module Listener : sig ... endNetwork connection listeners.
val with_listener :
?nonblock:bool ->
?socket_type:Unix.socket_type ->
?backlog:int ->
on:Endpoint.t ->
(Listener.t -> 'a) ->
('a, string) Stdlib.resultwith_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.
module Msg : sig ... endSend and receive messages over stream sockets.
pp_sock_addr formats socket addresses for inspection.