164 |
if not (Ip.valid ip) then |
if not (Ip.valid ip) then |
165 |
failwith "Invalid IP for server\n"; |
failwith "Invalid IP for server\n"; |
166 |
let port = s.server_host.host_port in |
let port = s.server_host.host_port in |
167 |
if !verbose_msg_servers then begin |
if !verbose_msg_servers then |
168 |
lprintf "CONNECT TO %s:%d\n" |
lprintf "CONNECT TO %s:%d\n" |
169 |
(Ip.string_of_addr h.host_addr) port; |
(Ip.string_of_addr h.host_addr) port; |
|
end; |
|
170 |
H.set_request h Tcp_Connect; |
H.set_request h Tcp_Connect; |
171 |
H.try_connect h; |
H.try_connect h; |
172 |
(* Standard Kazaa clients send a ping first, and only connect if they |
(* Standard Kazaa clients send a ping first, and only connect if they |
385 |
with _ -> find_ultrapeer queue |
with _ -> find_ultrapeer queue |
386 |
|
|
387 |
let ft_boot () = |
let ft_boot () = |
388 |
|
let imesh_ip = Ip.addr_of_string "fm2.imesh.com" in |
389 |
let (h : host) = |
let (h : host) = |
390 |
if !verbose then lprintf "BOOTSTRAPPING FORM IMESH\n"; |
if !verbose then lprintf_nl "FT: Bootstrapping from Imesh %s" (Ip.string_of_addr imesh_ip); |
391 |
H.new_host (Ip.addr_of_string "fm2.imesh.com") 1214 IndexServer |
H.new_host imesh_ip 1214 IndexServer |
392 |
in |
in |
393 |
connect_server h |
connect_server h |
394 |
|
|
400 |
with _ -> |
with _ -> |
401 |
(* lprintf "not in ultrapeers_waiting_queue\n"; *) |
(* lprintf "not in ultrapeers_waiting_queue\n"; *) |
402 |
if !!bootstrap_from_imesh then |
if !!bootstrap_from_imesh then |
403 |
|
let imesh_ip = Ip.addr_of_string "fm2.imesh.com" in |
404 |
let (h : host) = |
let (h : host) = |
405 |
if !verbose then lprintf "BOOTSTRAPPING FORM IMESH\n"; |
if !verbose then lprintf_nl "FT: Bootstrapping from Imesh %s" (Ip.string_of_addr imesh_ip); |
406 |
H.new_host (Ip.addr_of_string "fm2.imesh.com") 1214 IndexServer in |
H.new_host (Ip.addr_of_string "fm2.imesh.com") 1214 IndexServer in |
407 |
find_ultrapeer peers_waiting_queue |
find_ultrapeer peers_waiting_queue |
408 |
else raise Not_found |
else raise Not_found |