Created
February 7, 2011 11:05
-
-
Save avsm/814254 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module type FLOW = sig | |
(* Type of an individual flow *) | |
type t | |
(* Type that manages a collection of flows *) | |
type mgr | |
(* Type that identifies a flow source and destination endpoint *) | |
type src | |
type dst | |
(* Read and write to a flow *) | |
val read: t -> OS.Istring.View.t option Lwt.t | |
val write: t -> OS.Istring.View.t -> unit Lwt.t | |
val close: t -> unit Lwt.t | |
(* Flow construction *) | |
val listen: mgr -> src -> (dst -> t -> unit Lwt.t) -> unit Lwt.t | |
val connect: mgr -> src -> dst -> (t -> unit Lwt.t) -> unit Lwt.t | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TCPv4 : sig | |
type t | |
type mgr = Manager.t | |
type src = ipv4_addr option * int | |
type dst = ipv4_addr * int | |
val read : t -> OS.Istring.View.t option Lwt.t | |
val write : t -> OS.Istring.View.t -> unit Lwt.t | |
val close : t -> unit Lwt.t | |
val listen : mgr -> src -> (dst -> t -> unit Lwt.t) -> unit Lwt.t | |
val connect : mgr -> src -> dst -> (t -> unit Lwt.t) -> unit Lwt.t | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment