Skip to content

Instantly share code, notes, and snippets.

@tizoc
Created January 2, 2011 14:10
Show Gist options
  • Save tizoc/762554 to your computer and use it in GitHub Desktop.
Save tizoc/762554 to your computer and use it in GitHub Desktop.
(* http://ocaml.janestreet.com/?q=node/75 *)
(* 1ra *)
type connection_state =
| Connecting
| Connected
| Disconnected
type connection_info = {
state: connection_state;
server: Inet_addr.t;
last_ping_time: Time.t option;
last_ping_id: int option;
session_id: string option;
when_initiated: Time.t option;
when_disconnected: Time.t option;
}
(* 2da *)
type connecting = { when_initiated: Time.t; }
type connected = { last_ping: (Time.t * int) option;
session_id: string; }
type disconnected = { when_disconnected: Time.t; }
type connection_state =
| Connecting of connecting
| Connected of connected
| Disconnected of disconnected
type connection_info = {
state: connection_state;
server: Inet_addr.t;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment