class endpoint : t ->
object
.. end
Use new endpoint sock
to construct an object derived from
Cf_sock_common.T.basic
that sports methods for sending data to and
receiving data from an already connected socket sock
.
Inherits
method virtual getsockname : address_t
Use obj#getsockname
to obtain the actual local address
associated with the socket. Raises Unix.Error
if there is an
error.
method virtual getpeername : address_t
Use obj#getpeername
to obtain the actual remote address
associated with the socket. Raises Unix.Error
if there is an
error.
method send : ?flags:Cf_socket.msg_flags_t -> string -> int -> int -> int
Use self#send ?flags buf pos len
to send len
octets from
the string buf
starting at position pos
, optionally with
the flags indicated by flags
. Returns the number of octets
actually sent. Raises Unix.Error
if there is an error.
Raises Invalid_argument
if pos
and len
do not correspond
to a valid substring of buf
.
method recv : ?flags:Cf_socket.msg_flags_t -> string -> int -> int -> int
Use obj#recv ?flags buf pos len
to receive len
octets to
the string buf
starting at position pos
, optionally with
the flags indicated by flags
. Returns the number of octets
actually received. Raises Unix.Error
if there is an error.
Raises Invalid_argument
if pos
and len
do not correspond
to a valid substring of buf
.
method virtual 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.