package core_extended

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Networking utilities

  • author Markus Mottl <mmottl\@janestreet.com>
exception Timeout

Exception raised if a connection attempt timed out

val h_name_of_sockaddr : Unix.sockaddr -> string

Get hostname from sockaddr

val string_of_sockaddr : Unix.sockaddr -> string

Get string from sockaddr

val h_name_or_string_of_sockaddr : Unix.sockaddr -> string

Get hostname or (on Not_found) inet string from sockaddr

val inet_addr_of_sockaddr : Unix.sockaddr -> Unix.inet_addr

Get inet_addr from sockaddr

val port_of_sockaddr : Unix.sockaddr -> int

Get port from sockaddr

val port_of_in_channel : Stdlib.in_channel -> int

Get port from a socket associated with an in_channel

val tcp_socket : unit -> Unix.file_descr

Create a standard TCP/IP-socket

val connect_tmout : Unix.file_descr -> Unix.sockaddr -> Core.Unix.select_timeout -> bool

Connect a socket with a connect timeout

val open_fd_connection_tmout : con_timeout:Core.Unix.select_timeout -> rcv_timeout:float -> snd_timeout:float -> Unix.sockaddr -> Unix.file_descr

Create a socket with timeouts

val open_connection_tmout : con_timeout:Core.Unix.select_timeout -> rcv_timeout:float -> snd_timeout:float -> Unix.sockaddr -> Stdlib.in_channel * Stdlib.out_channel

Open a connection with timeouts

val set_in_channel_timeout : Stdlib.in_channel -> float -> unit

Set a timeout for a socket associated with an in_channel

val set_out_channel_timeout : Stdlib.out_channel -> float -> unit

Set a timeout for a socket associated with an out_channel

OCaml

Innovation. Community. Security.