Module Luv__.Handle

Basics

type '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.

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

Closes the given handle.

Binds uv_close.

val is_active : _ t -> bool

Binds uv_is_active.

val is_closing : _ t -> bool

Binds uv_is_closing.

val ref : _ t -> unit

Binds uv_ref.

val unref : _ t -> unit

Binds uv_unref.

val has_ref : _ t -> bool

Binds uv_has_ref.

val get_loop : _ t -> Luv.Loop.t

Binds uv_get_loop.

I/O properties

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

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

Calls uv_send_buffer_size with *value set to zero.

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

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

Calls uv_recv_buffer_size with *value set to zero.

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

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

Calls uv_send_buffer_size with *value set to the given value.

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

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

Calls uv_recv_buffer_size with *value set to the given value.

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

Retrieves the file descriptor associated with the handle.

Binds uv_fileno.