Module Socket

module Socket: sig .. end
Socket module


used in both universe module and world module
val close : Unix.file_descr -> unit
close file_descr
val send : 'a -> Unix.file_descr -> unit
send a message
val receive : Unix.file_descr -> 'a
receive a message
val tcflush : Unix.file_descr -> unit
destroy unprocessed data in sockfd
val make_sockfd : unit -> Unix.file_descr
make a socket

used in universe module
val select_read : Unix.file_descr list -> Unix.file_descr list
return a list of file_descr which got messages
val new_client_sockfd : Unix.file_descr -> Unix.file_descr
return file_descr which has connection request
val portnum : Unix.file_descr -> int
receive Unix.file_descr of a server and return the port number of the server
val listen : Unix.file_descr -> unit
setup to receive connection requests to Unix.file_descr

used in world module
val connect : string * string -> Unix.file_descr -> unit
receive a pair of an ip address and a port number, and client_sockfd; then connect to a server