NetmsgSend messages over stream sockets.
val connect : endpoint:Funix.endpoint -> (t option, string) Stdlib.resultconnect ~endpoint connects to a server offered on endpoint endpoint. None is returned if no server could be found.
val close : t -> unitclose c closes a connection. This never errors.
val fd : t -> Unix.file_descrfd c is the file descriptor of c.
val send : t -> string -> (bool, string) Stdlib.resultsend c s sends bytes s on c. The result is Ok false if the peer ends the connection, no guarantees that the message went through.
val recv : t -> (string option, string) Stdlib.resultrecv c receives bytes from c and is Ok None if the peer ends the connection.
val listener :
?backlog:int ->
endpoint:Funix.endpoint ->
unit ->
(listener, string) Stdlib.resultlistener ~backlog ~endpoint () is a connection listener on endpoint. backlog is the argument for Unix.listen (defaults to 128).
listen ~endpoint offers a connection on endpoint. Blocks until a client connects. The caller must eventually close the connection.
val close_listener : listener -> unitclose_listener l closes listener l.