MCPcopy Create free account
hub / github.com/davisking/dlib / connect_all_hostinfo

Function connect_all_hostinfo

dlib/bsp/bsp.cpp:35–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 }
34
35 void connect_all_hostinfo (
36 map_id_to_con& cons,
37 const std::vector<hostinfo>& hosts,
38 unsigned long node_id,
39 std::string& error_string
40 )
41 {
42 cons.clear();
43 for (unsigned long i = 0; i < hosts.size(); ++i)
44 {
45 try
46 {
47 std::unique_ptr<bsp_con> con(new bsp_con(hosts[i].addr));
48 dlib::serialize(node_id, con->stream); // tell the other end our node_id
49 con->stream.flush();
50 unsigned long id = hosts[i].node_id;
51 cons.add(id, con);
52 }
53 catch (std::exception&)
54 {
55 std::ostringstream sout;
56 sout << "Could not connect to " << hosts[i].addr;
57 error_string = sout.str();
58 break;
59 }
60 }
61 }
62
63
64 void send_out_connection_orders (

Callers

nothing calls this directly

Calls 6

serializeFunction · 0.70
clearMethod · 0.45
sizeMethod · 0.45
flushMethod · 0.45
addMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected