MCPcopy Create free account
hub / github.com/crownengine/crown / remove_client_by_socket

Function remove_client_by_socket

src/device/console_server.cpp:186–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184 }
185
186 static void remove_client_by_socket(ConsoleServer &cs, const TCPSocket &socket)
187 {
188 ScopedMutex scoped_mutex(cs._clients_mutex);
189
190 const u32 last = vector::size(cs._clients) - 1;
191 for (u32 cc = 0; cc < vector::size(cs._clients); ++cc) {
192 if (cs._clients[cc].socket == socket) {
193 cs._clients[cc] = cs._clients[last];
194 vector::pop_back(cs._clients);
195 return;
196 }
197 }
198 }
199
200 static u32 get_client_id(ConsoleServer &cs, const TCPSocket &socket)
201 {

Callers 1

run_input_threadMethod · 0.85

Calls 1

sizeFunction · 0.50

Tested by

no test coverage detected