package ssl

  1. Overview
  2. Docs

Module Ssl.Runtime_lockSource

Runtime_lock is an equivalent, signature compatible, equivalent to the Ssl module, with one difference: the OCaml runtime lock isn't released before calling the underlying SSL primitives. Multiple systhreads cannot, therefore, run concurrently.

It works well with non blocking sockets where the usual semantics apply, i.e. handling of `EWOULDBLOCK`, `EGAIN`, etc. Additionally, the functions in this module don't perform a copy of application data buffers.

Sourceval connect : socket -> unit

Connect an SSL socket.

Sourceval accept : socket -> unit

Accept an SSL connection.

Sourceval open_connection : protocol -> Unix.sockaddr -> socket

Open an SSL connection.

Sourceval open_connection_with_context : context -> Unix.sockaddr -> socket

Open an SSL connection with the specified context.

Sourceval close_notify : socket -> bool

Send close notify to the peer. This is SSL_shutdown(3). * returns true if shutdown is finished, false in case close_notify * needs to be called a second time.

Sourceval shutdown_connection : socket -> unit

Close an SSL connection opened with open_connection.

Sourceval shutdown : socket -> unit

Close a SSL connection. * Send close notify to the peer and wait for close notify from peer.

Sourceval flush : socket -> unit

Flush an SSL connection.

Sourceval read : socket -> Bytes.t -> int -> int -> int

read sock buf off len receives data from a connected SSL socket.

Sourceval read_into_bigarray : socket -> bigarray -> int -> int -> int

read_into_bigarray sock ba off len receives data from a connected SSL socket. This function releases the runtime while the read takes place.

Sourceval write : socket -> Bytes.t -> int -> int -> int

write sock buf off len sends data over a connected SSL socket.

Sourceval write_substring : socket -> string -> int -> int -> int

write_substring sock str off len sends data over a connected SSL socket.

Sourceval write_bigarray : socket -> bigarray -> int -> int -> int

write_bigarray sock ba off len sends data over a connected SSL socket. This function releases the runtime while the read takes place.

High-level communication functions

Sourceval input_string : socket -> string

Input a string on an SSL socket.

Sourceval output_string : socket -> string -> unit

Write a string on an SSL socket.

Sourceval input_char : socket -> char

Input a character on an SSL socket.

Sourceval output_char : socket -> char -> unit

Write a char on an SSL socket.

Sourceval input_int : socket -> int

Input an integer on an SSL socket.

Sourceval output_int : socket -> int -> unit

Write an integer on an SSL socket.