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

Method get_connection_socket

Networking/ServerSocket.cpp:196–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196int ServerSocket::get_connection_socket(const string& id)
197{
198 data_signal.lock();
199 if (used.find(id) != used.end())
200 {
201 stringstream ss;
202 ss << "Connection id " << hex << id << " already used";
203 throw IO_Error(ss.str());
204 }
205
206 while (clients.find(id) == clients.end())
207 {
208 if (data_signal.wait(CONNECTION_TIMEOUT) == ETIMEDOUT)
209 exit_error("Timed out waiting for peer. See "
210 "https://mp-spdz.readthedocs.io/en/latest/networking.html "
211 "for details on networking.");
212 }
213
214 int client_socket = clients[id];
215 used.insert(id);
216 data_signal.unlock();
217 return client_socket;
218}
219
220void* anonymous_accept_thread(void* server_socket)
221{

Callers 3

startMethod · 0.80
setup_socketsMethod · 0.80
get_client_connectionMethod · 0.80

Calls 11

IO_ErrorClass · 0.85
exit_errorFunction · 0.85
runtime_errorFunction · 0.85
lockMethod · 0.45
endMethod · 0.45
strMethod · 0.45
waitMethod · 0.45
insertMethod · 0.45
unlockMethod · 0.45
emptyMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected