Class Cf_sock_common.T.basic


class basic : ?sock:t -> unit -> object .. end
The base class for all sockets of this protocol. Use inherit basic ?sock () to derive a new class. If sock is not provided, then a new socket is created, raising Unix.Error if an error is encountered.

val socket_ : t
The socket
method socket : t
Returns the socket.
method fd : Unix.file_descr
Returns the Unix.file_desc corresponding to the socket.
method close : unit
Use obj#close to close the socket. Raises Unix.Error if there is an error.
method dup : t
Use obj#dup to duplicate the socket. Raises Unix.Error if there is an error.
method dup2 : t -> unit
Use obj#dup2 sock to duplicate the socket, overwriting the socket sock in the process. Raises Unix.Error if there is an error.
method getsockopt : 'a. ('a, P.AF.tag, P.ST.tag) Cf_socket.sockopt -> 'a
Use obj#getsockopt opt to get the value of the socket option opt. Raises Unix.Error if there is an error.
method setsockopt : 'b. ('b, P.AF.tag, P.ST.tag) Cf_socket.sockopt -> 'b -> unit
Use obj#setsockopt opt v to set the value of the socket option opt. Raises Unix.Error if there is an error.
method private getsockname : address
Use self#getsockname to get the locally bound endpoint address of the socket. Raises Unix.Error if there is an error.
method private getpeername : address
Use self#getsockname to get the remotely bound endpoint address of the socket. Raises Unix.Error if there is an error.
method private shutdown : Unix.shutdown_command -> unit
Use obj#shutdown cmd to shutdown either sending or receiving (or both) on the socket. Raises Unix.Error if there is an error.
method private bind : address -> unit
Use self#bind sa to bind the local endpoint address of the socket to the socket address sa. Raises Unix.Error if there is an error.