package luv

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

Module Luv.HandleSource

Handles.

See Handles in the user guide and uv_handle_tBase handle in libuv.

In libuv, uv_handle_t is a sort of “abstract” base type that supports functions common to all handles. All concrete handles are of more specific types, such as uv_udp_t.

Correspondingly, this module, Luv.Handle, offers functions that work on all handles, _ Luv.Handle.t. Other modules define specific handle types, such as Luv.UDP.t, which is defined as [`UDP] Luv.Handle.t.

The full list of concrete handle types:

Basics

Sourcetype 'kind t = 'kind Luv_c_types.Handle.t Ctypes.ptr

Binds uv_handle_t.

There is no way to directly create values of this type through this module, Luv.Handle. See other modules, which bind specific handle types, such as Luv.UDP.

Sourceval close : _ t -> (unit -> unit) -> unit

Closes the given handle.

Binds uv_close.

Sourceval is_active : _ t -> bool
Sourceval is_closing : _ t -> bool
Sourceval ref : _ t -> unit

Binds uv_ref.

Sourceval unref : _ t -> unit

Binds uv_unref.

Sourceval has_ref : _ t -> bool

Binds uv_has_ref.

Sourceval get_loop : _ t -> Loop.t

I/O properties

Sourceval send_buffer_size : [< `Stream of [< `TCP | `Pipe ] | `UDP ] t -> (int, Error.t) result

Gets the size of the OS send buffer for a socket.

Calls uv_send_buffer_size with *value set to zero.

Sourceval recv_buffer_size : [< `Stream of [< `TCP | `Pipe ] | `UDP ] t -> (int, Error.t) result

Gets the size of the OS receive buffer for a socket.

Calls uv_recv_buffer_size with *value set to zero.

Sourceval set_send_buffer_size : [< `Stream of [< `TCP | `Pipe ] | `UDP ] t -> int -> (unit, Error.t) result

Sets the size of the OS send buffer for a socket.

Calls uv_send_buffer_size with *value set to the given value.

Sourceval set_recv_buffer_size : [< `Stream of [< `TCP | `Pipe ] | `UDP ] t -> int -> (unit, Error.t) result

Sets the size of the OS receive buffer for a socket.

Calls uv_recv_buffer_size with *value set to the given value.

Sourceval fileno : [< `Stream of [< `TCP | `Pipe | `TTY ] | `UDP | `Poll ] t -> (Os_fd.Fd.t, Error.t) result

Retrieves the file descriptor associated with the handle.

Binds uv_fileno.

OCaml

Innovation. Community. Security.