UwtUwt main module
Basic overview:
libuv manual. Selected parts of the manual are now included inside the mli files (credits to Authors), the libuv manual is however more up-to-date.uv_req_t is kept internal.lwt.unix. It's not a further Lwt_engine in addition to select and libev.Please notice, that there are subtle differences compared to lwt.unix. Because all requests are accomplished by libuv (sometimes in parallel in different threads), you don't have that kind of low level control, that you have with lwt.unix. Also Lwt.cancel behaves differently and you won't notice it by looking at the type information.
Stream.write and related functions can never be canceled. The analogous write functions in Lwt_unix however are cancelable as long as the underlying file descriptor is not opened in blocking mode. (Stream.read currently returns the only cancelable thread inside Stream and its subclasses. But there is no guarantee that Tcp.read will continue to be cancelable under Windows in future libuv versions.)Lwt_unix.include module type of Uwt_base
with type error = Uwt_base.error
with type 'a uv_result = 'a Uwt_base.uv_result
with type file = Uwt_base.file
with type sockaddr = Uwt_base.sockaddr
with type 'a Int_result.t = 'a Uwt_base.Int_result.t
with type Fs_types.uv_open_flag = Uwt_base.Fs_types.uv_open_flag
with type Fs_types.file_kind = Uwt_base.Fs_types.file_kind
with type Fs_types.symlink_mode = Uwt_base.Fs_types.symlink_mode
with type Fs_types.access_permission = Uwt_base.Fs_types.access_permission
with type Fs_types.stats = Uwt_base.Fs_types.stats
with type Misc.timeval = Uwt_base.Misc.timeval
with type Misc.rusage = Uwt_base.Misc.rusage
with type Misc.cpu_times = Uwt_base.Misc.cpu_times
with type Misc.cpu_info = Uwt_base.Misc.cpu_info
with type Misc.interface_address = Uwt_base.Misc.interface_address
with type Misc.handle_type = Uwt_base.Misc.handle_type
with type Misc.version = Uwt_base.Misc.version
with type Iovec_write.t = Uwt_base.Iovec_write.tUwt_base contains type definitions and functions that are shared by Uwt and Uv_fs_sync
type error = Uwt_base.error = | E2BIGargument list too long
*)| EACCESpermission denied
*)| EADDRINUSEaddress already in use
*)| EADDRNOTAVAILaddress not available
*)| EAFNOSUPPORTaddress family not supported
*)| EAGAINresource temporarily unavailable
*)| EAI_ADDRFAMILYaddress family not supported
*)| EAI_AGAINtemporary failure
*)| EAI_BADFLAGSbad ai_flags value
*)| EAI_BADHINTSinvalid value for hints
*)| EAI_CANCELEDrequest canceled
*)| EAI_FAILpermanent failure
*)| EAI_FAMILYai_family not supported
*)| EAI_MEMORYout of memory
*)| EAI_NODATAno address
*)| EAI_NONAMEunknown node or service
*)| EAI_OVERFLOWargument buffer overflow
*)| EAI_PROTOCOLresolved protocol is unknown
*)| EAI_SERVICEservice not available for socket type
*)| EAI_SOCKTYPEsocket type not supported
*)| EALREADYconnection already in progress
*)| EBADFbad file descriptor
*)| EBUSYresource busy or locked
*)| ECANCELEDoperation canceled
*)| ECHARSETWindows filenames (and similar parameters) are expected to be utf-8 encoded. ECHARSET is returned, if one parameter contains invalid byte sequences. Furthermore, ECHARSET will be returned, if your strings contain null bytes (on *nix, too).
| ECONNABORTEDsoftware caused connection abort
*)| ECONNREFUSEDconnection refused
*)| ECONNRESETconnection reset by peer
*)| EDESTADDRREQdestination address required
*)| EEXISTfile already exists
*)| EFAULTbad address in system call argument
*)| EFBIGfile too large
*)| EHOSTUNREACHhost is unreachable
*)| EINTRinterrupted system call
*)| EINVALinvalid argument
*)| EIOi/o error
*)| EISCONNsocket is already connected
*)| EISDIRillegal operation on a directory
*)| ELOOPtoo many symbolic links encountered
*)| EMFILEtoo many open files
*)| EMSGSIZEmessage too long
*)| ENAMETOOLONGname too long
*)| ENETDOWNnetwork is down
*)| ENETUNREACHnetwork is unreachable
*)| ENFILEfile table overflow
*)| ENOBUFSno buffer space available
*)| ENODEVno such device
*)| ENOENTno such file or directory
*)| ENOMEMnot enough memory
*)| ENONETmachine is not on the network
*)| ENOPROTOOPTprotocol not available
*)| ENOSPCno space left on device
*)| ENOSYSfunction not implemented
*)| ENOTCONNsocket is not connected
*)| ENOTDIRnot a directory
*)| ENOTEMPTYdirectory not empty
*)| ENOTSOCKsocket operation on non-socket
*)| ENOTSUPoperation not supported on socket
*)| EPERMoperation not permitted
*)| EPIPEbroken pipe
*)| EPROTOprotocol error
*)| EPROTONOSUPPORTprotocol not supported
*)| EPROTOTYPEprotocol wrong type for socket
*)| ERANGEresult too large
*)| EROFSread-only file system
*)| ESHUTDOWNcannot send after transport endpoint shutdown
*)| ESPIPEinvalid seek
*)| ESRCHno such process
*)| ETIMEDOUTconnection timed out
*)| ETXTBSYtext file is busy
*)| EXDEVcross-device link not permitted
*)| UNKNOWNunknown error
*)| EOFend of file
*)| ENXIOno such device or address
*)| EMLINKtoo many links
*)| EHOSTDOWNhost is down
*)| EREMOTEIOremote I/O error
*)| ENOTTYinappropriate ioctl for device
*)| EFTYPEinappropriate file type or format
*)| UWT_EFATALsomething happened that the author of uwt didn't expect. Probably a bug or the api of libuv has changed in the meanwhile
*)val strerror : error -> stringerror message for the given error code
val err_name : error -> stringerror name for the given error code
val to_unix_error : error -> Unix.errormap error to Unix.error , Unix.EUNKNOWNERR is used, if the mapping is not possible
val of_unix_error : Unix.error -> errorget back the original Uwt.error from an exception raised by a Uwt function
type 'a uv_result = 'a Uwt_base.uv_resultmodule Int_result : sig ... endInt_result.t is used instead of 'a result, if a function returns either an error or a non-negative integer (including unit/bool).
type file = Uwt_base.fileAbstract type for a file descriptor. Unlike Unix.file_descr it is not intended to wrap a SOCKET.
type sockaddr = Uwt_base.sockaddrtype buf =
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.tval stdin : fileFile descriptor for standard input.
val stdout : fileFile descriptor for standard output.
val stderr : fileFile descriptor for standard error.
module Iovec_write : sig ... endpass multiple buffers at once to a libuv write function.
module Fs_types : sig ... endmodule type Fs_functions = sig ... endmodule Conv : sig ... endmodule Misc : sig ... endThis section contains miscellaneous functions that don't really belong in any other section.
module Sys_info : sig ... endInformation about your operating system.
module Main : sig ... endAnalogue of Lwt_main
module Fs : sig ... endmodule Handle_ext : sig ... endmodule Handle_fileno : sig ... endThe usage of fileno is unsafe and strongly discouraged. But it's sometimes necessary, if you need to interact with third parties libraries. Rules:
module Stream : sig ... endStream handles provide an abstraction of a duplex communication channel. Stream.t is an abstract type, libuv provides 3 stream implementations in the form of Tcp.t, Pipe.t and Tty.t.
module Tcp : sig ... endTCP handles are used to represent both TCP streams and servers.
module Udp : sig ... endUDP handles encapsulate UDP communication for both clients and servers.
module Tty : sig ... endTTY handles represent a stream for the console.
module Pipe : sig ... endPipe handles provide an abstraction over local domain sockets on Unix and named pipes on Windows.
module Timer : sig ... endTimer handles are used to schedule callbacks to be called in the future.
module Signal : sig ... endSignal handles implement Unix style signal handling on a per-event loop bases.
module Poll : sig ... endPoll handles are used to watch file descriptors for readability, writability and disconnection similar to the purpose of poll(2).
module Fs_event : sig ... endFS Event handles allow the user to monitor a given path for changes, for example, if the file was renamed or there was a generic change in it. This handle uses the best backend for the job on each platform.
module Fs_poll : sig ... endFS Poll handles allow the user to monitor a given path for changes. Unlike Fs_event.t, fs poll handles use stat to detect when a file has changed so they can work on file systems where fs event handles can't.
module Process : sig ... endProcess handles will spawn a new process and allow the user to control it and establish communication channels with it using streams.
module Dns : sig ... endlibuv provides asynchronous variants of getaddrinfo and getnameinfo.
module Unix : sig ... endPopular functions from the standard Unix module, but all calls are executed in work threads.
module C_worker : sig ... endmodule Async : sig ... endAsync handles allow the user to "wakeup" the event loop and get a callback called from another (system) thread.
module Debug : sig ... endCommon helper for ad hoc debugging. Don't use them inside production code.