Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / basic / net.sig
CommitLineData
7f918cf1
CE
1(* Copyright (C) 2009 Matthew Fluet.
2 * Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 *
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
7 *)
8
9signature NET =
10 sig
11 type port = int
12
13 (* canPing m returns true if a ping to machine m succeeds. *)
14 val canPing: string -> bool
15 (* connect{host, port} connects to host on port and
16 * returns the streams to read to and write from the socket.
17 *)
18 val connect: {host: string, port: port} -> In.t * Out.t
19 val ethernetIsUp: unit -> bool
20 val fullHostname: string
21 val hostname: string
22 val repeat: {limit: Time.t, tries: int} option ref
23 (* server(p, f) starts a server listening on port p. Whenever a connection
24 * is received, f is run with streams corresponding to the socket.
25 *)
26 val server: port * (In.t * Out.t -> unit) -> unit
27 end