Low level UDP network access
exception Error of
Exception Error is raised when the operating system cannot compleat
the requested operation, for example "Out of memory"
Type representing either a connected or a listening (bound) UDP socket
Type representing the net address of a host used to recognize clients
val connect :
string -> int -> socket
connect hostname port creates a socket ready to send to specified host.
You need to send without providing destination address or to use module
val poll :
socket -> float -> bool
poll sock timeout checks if any new messages arrived to the given
val send :
socket -> ?dest:address -> string -> int -> int -> unit
send sock to msg pos len sends given message to host connected with sock
or to given destination.
Error if sock is not connected and dest is
val recv :
socket -> string -> int -> int -> int * address
recv sock msg pos len returns number of bytes read and who sent it.
It mat return (0, _) if no data recved
val create_socket :
int -> socket
new_socket port creates a listening socket on the given port.
val close :
socket -> unit
close sock should be used to disconnect or unbind the given socket
val describe_connection :
address -> string
describe_connection address returns a string representation of the
given net address