Module Protocol


module Protocol: sig  end
Medium level UDP network protocol

exception Error of string
Exception raised when information given or received does not match protocol

type t =
| I of int
| C of char
| F of float
| S of string
| List of t list
Type that can be transferred through net. Examples of typing:
val c2s_add : string ->
(Udp.address -> t list -> unit) ->
Udp.socket -> t list -> unit
c2s_add params recv_fun adds a new message to the protocol. The * additional parameters transmitted with each message are specified in * params in format "ICCS". add also takse the fucntion called after * having received the message and returns the sender of the message
val s2c_add : string ->
(t list -> unit) ->
Udp.socket -> Udp.address -> t list -> unit
like Protocol.c2s_add, but from server to clients
val client_net_check : Udp.socket -> unit
client_net_check () checks the connection for received messages and * calls all receivers.
val server_net_check : Udp.socket -> unit
server_net_check () checks the socket for new clients and for * received messages. It also calls all receivers.