30 |
let send_paquet_to_mlchat (p : C.packet) = |
let send_paquet_to_mlchat (p : C.packet) = |
31 |
let domain = Unix.PF_INET in |
let domain = Unix.PF_INET in |
32 |
let sock = Unix.socket domain Unix.SOCK_STREAM 0 in |
let sock = Unix.socket domain Unix.SOCK_STREAM 0 in |
33 |
let inet_addr = |
let inet_addr = |
34 |
let host = !!O.chat_app_host in |
let host = !!O.chat_app_host in |
35 |
try Unix.inet_addr_of_string host |
try Unix.inet_addr_of_string host |
36 |
with _ -> |
with _ -> |
62 |
let send_chat_proto name ad_opt m = |
let send_chat_proto name ad_opt m = |
63 |
let ad = |
let ad = |
64 |
match ad_opt with |
match ad_opt with |
65 |
None -> |
None -> |
66 |
(* utiliser le port de chat et l'hostname du core donkey *) |
(* utiliser le port de chat et l'hostname du core donkey *) |
67 |
(Unix.gethostname (), !!O.chat_port) |
(Unix.gethostname (), !!O.chat_port) |
68 |
| Some ad -> ad |
| Some ad -> ad |
75 |
send_chat_proto name ad_opt (C.Message s) |
send_chat_proto name ad_opt (C.Message s) |
76 |
|
|
77 |
let send_add_open name ad_opt = |
let send_add_open name ad_opt = |
78 |
let ad = |
let ad = |
79 |
match ad_opt with |
match ad_opt with |
80 |
None -> (Unix.gethostname (), !!O.chat_port) |
None -> (Unix.gethostname (), !!O.chat_port) |
81 |
| Some ad -> ad |
| Some ad -> ad |