Commits

Dmitry Grebeniuk  committed 36436af

dump_*_addr

  • Participants
  • Parent commits a5af3c3

Comments (0)

Files changed (1)

File src/amall_types.ml

 ;
 
 
+value dump_connect_addr (connect_addr : connect_addr) =
+  let open Printf in
+  match connect_addr with
+  [ `Inet_loopback p -> sprintf "loopback:%i" p
+  | `Inet_str s p -> sprintf "%s:%i" s p
+  | `Inet_addr a p -> sprintf "%s:%i" (Unix.string_of_inet_addr a) p
+  | `Unix_socket p -> sprintf "unix:" ^ p
+  ]
+;
+
+value dump_listen_addr (listen_addr : listen_addr) =
+  match listen_addr with
+  [ #connect_addr as ca -> dump_connect_addr ca
+  | `Inet_any p -> Printf.sprintf "anyip:%i" p
+  ]
+;
+
+
 module type IO_Type =
   sig
     type m +'a;