module Netsys_types:sig
..end
string
type,
and strings were mutable (although frequently used as if there were
immutable). Since OCaml-4.02 there is the immutable string
and
the mutable bytes
type.
The general strategy for switching to the string/bytes scheme is
to replace string
everywhere with bytes
, and to provide
additional functions taking strings as input or output where it
makes sense. There are exceptions, though, e.g. when the string
acts as a key in a data structure.
The type name "string" also occurs in function names (e.g.
"get_string") and in variant names (e.g. String_case
). As we
want to be backward compatible, we keep the old names for functions
on bytes
, and mark them as deprecated.
typememory =
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
typetbuffer =
[ `Bytes of Bytes.t | `Memory of memory | `String of Bytes.t ]
`String
case is deprecated, and only
provided for backward compatibility.typetstring =
[ `Bytes of Bytes.t | `Memory of memory | `String of string ]
Netstring_tstring
.class type mstring =object
..end
Netxdr_mstring.mstring
for documentation
exception EAGAIN_RD
exception EAGAIN_WR
Unix.EAGAIN
error but includes whether it was a read or write.
When the read or write is possible, the interrupted function should simply be again called.
These two exceptions are preferred by TLS providers.
exception TLS_switch_request
exception TLS_switch_response of bool
true
means acceptance.exception TLS_error of string
exception TLS_warning of string