package luv

  1. Overview
  2. Docs
Binding to libuv: cross-platform asynchronous I/O

Install

Dune Dependency

Authors

Maintainers

Sources

luv-0.5.6.tar.gz
sha256=35d8092d7a7e8d00a7ab8caf79d99e2073baf1999f5b9274de4d69078ad83685
md5=fb78fd1b179f5c9585e79b5a1c5ff644

doc/luv/Luv/TCP/index.html

Module Luv.TCPSource

TCP sockets.

See TCP in the user guide and uv_tcp_t — TCP handle in libuv.

Sourcetype t = [ `TCP ] Stream.t

Binds uv_tcp_t.

Note that values of this type can also be used with functions in:

In particular, see Luv.Handle.close, Luv.Stream.accept, Luv.Stream.read_start, Luv.Stream.write.

Sourceval init : ?loop:Loop.t -> ?domain:Sockaddr.Address_family.t -> unit -> (t, Error.t) Result.result

Allocates and initializes a TCP stream.

Binds uv_tcp_init_ex.

The stream is not yet connected or listening. See Luv.TCP.bind, Luv.Stream.listen, and Luv.Stream.connect.

Sourceval open_ : t -> Os_fd.Socket.t -> (unit, Error.t) Result.result

Wraps an existing socket in a libuv TCP stream.

Binds uv_tcp_open.

Sourceval nodelay : t -> bool -> (unit, Error.t) Result.result

Sets TCP_NODELAY.

Binds uv_tcp_nodelay.

Sourceval keepalive : t -> int option -> (unit, Error.t) Result.result

Sets the TCP keepalive.

Binds uv_tcp_keepalive.

Sourceval simultaneous_accepts : t -> bool -> (unit, Error.t) Result.result

Sets simultaneous accept.

Binds uv_tcp_simultaneous_accepts.

Sourceval bind : ?ipv6only:bool -> t -> Sockaddr.t -> (unit, Error.t) Result.result

Assigns an address to the given TCP socket.

Binds uv_tcp_bind. See bind(3p).

Sourceval getsockname : t -> (Sockaddr.t, Error.t) Result.result

Retrieves the address assigned to the given TCP socket.

Binds uv_tcp_getsockname. See getsockname(3p).

Sourceval getpeername : t -> (Sockaddr.t, Error.t) Result.result

Retrieves the address of the given TCP socket's peer.

Binds uv_tcp_getpeername. See getpeername(3p).

Sourceval connect : t -> Sockaddr.t -> ((unit, Error.t) Result.result -> unit) -> unit

Connects to a host.

Binds uv_tcp_connect. See connect(3p).

Sourceval close_reset : t -> ((unit, Error.t) Result.result -> unit) -> unit

Resets the connection.

Binds uv_tcp_close_reset.

OCaml

Innovation. Community. Security.