Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file netsys_types.ml
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889(* $Id$ *)(** Types for all Netsys modules *)(** {2 Bytes and characters} *)(** Remember that up to OCaml-4.01 there was only the [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(** We consider 1-dimensional bigarrays of chars as memory buffers.
They have the useful property that the garbage collector cannot
relocate them, i.e. the address is fixed. Also, one can mmap
a file, and connect the bigarray with shared memory.
*)typetbuffer=[`BytesofBytes.t|`Memoryofmemory|`StringofBytes.t](** A tagged buffer. Note that the [`String] case is deprecated, and only
provided for backward compatibility.
*)typetstring=[`BytesofBytes.t|`Memoryofmemory|`Stringofstring](** A tagged string which is considered as immutable. See also the
support module {!Netstring_tstring}.
*)(** See {!Netxdr_mstring.mstring} for documentation *)classtypemstring=objectmethodlength:intmethodblit_to_bytes:int->Bytes.t->int->int->unitmethodblit_to_string:int->Bytes.t->int->int->unitDEPRECATED("Use blit_to_bytes instead.")methodblit_to_memory:int->memory->int->int->unitmethodas_bytes:Bytes.t*intmethodas_string:string*intmethodas_memory:memory*intmethodpreferred:[`Memory |`Bytes]endexceptionEAGAIN_RDexceptionEAGAIN_WR(** A read or write cannot be done because the descriptor is in
non-blocking mode and would block. This corresponds to the
[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.
*)exceptionTLS_switch_request(** The server requested a rehandshake (this exception is thrown
in the client)
*)exceptionTLS_switch_responseofbool(** The client accepted or denied a rehandshake (this exception is thrown
in the server). [true] means acceptance.
*)exceptionTLS_errorofstring(** A fatal error occurred (i.e. the session needs to be terminated).
The string is a symbol identifying the error.
*)exceptionTLS_warningofstring(** A non-fatal error occurred. The interrupted function should be
called again.
The string is a symbol identifying the warning.
*)