MCPcopy Create free account
hub / github.com/data61/MP-SPDZ / get_client_connection

Method get_client_connection

Processor/ExternalClients.cpp:45–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45int ExternalClients::get_client_connection(int portnum_base)
46{
47 ScopeLock _(lock);
48 map<int,AnonymousServerSocket*>::iterator it = client_connection_servers.find(portnum_base);
49 if (it == client_connection_servers.end())
50 {
51 cerr << "Thread " << this_thread::get_id() << " didn't find server." << endl;
52 throw runtime_error("No connection on port " + to_string(portnum_base));
53 }
54 int client_id, socket;
55 string client;
56 socket = client_connection_servers[portnum_base]->get_connection_socket(
57 client);
58 client_id = stoi(client);
59 if (ctx == 0)
60 ctx = new client_ctx("P" + to_string(get_party_num()));
61 external_client_sockets[client_id] = new client_socket(io_service, *ctx, socket,
62 "C" + to_string(client_id), "P" + to_string(get_party_num()), false);
63 client_ports[client_id] = portnum_base;
64 if (OnlineOptions::singleton.verbose)
65 cerr << "Party " << get_party_num()
66 << " received external client connection from client id: " << dec
67 << client_id << endl;
68 return client_id;
69}
70
71int ExternalClients::init_client_connection(const string& host, int portnum,
72 int my_client_id)

Callers 1

executeMethod · 0.80

Calls 4

runtime_errorFunction · 0.85
get_connection_socketMethod · 0.80
to_stringFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected