MCPcopy Create free account
hub / github.com/defold/defold / DeleteSocket

Function DeleteSocket

engine/dlib/src/dlib/message.cpp:296–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294 }
295
296 Result DeleteSocket(HSocket socket)
297 {
298 MessageSocket* s = 0x0;
299 {
300 DM_SPINLOCK_SCOPED_LOCK(g_MessageSpinlock);
301 s = g_MessageContext->m_Sockets.Get(socket);
302 if (s == 0x0)
303 {
304 return RESULT_SOCKET_NOT_FOUND;
305 }
306
307 g_MessageContext->m_Sockets.Erase(s->m_NameHash);
308 --s->m_RefCount;
309
310 if(s->m_RefCount > 0)
311 {
312 // Defer deletion
313 return RESULT_OK;
314 }
315 }
316 DisposeSocket(s);
317 return RESULT_OK;
318 }
319
320 static Result GetSocketNoLock(dmhash_t name_hash, HSocket* out_socket)
321 {

Callers 15

DetachCollectionFunction · 0.85
TearDownMethod · 0.85
TearDownMethod · 0.85
TearDownMethod · 0.85
DeleteFunction · 0.85
TEST_FFunction · 0.85
TearDownMethod · 0.85
TEST_FFunction · 0.85
LogInitializeFunction · 0.85
LogFinalizeFunction · 0.85
TESTFunction · 0.85
DeleteFunction · 0.85

Calls 3

DisposeSocketFunction · 0.85
GetMethod · 0.45
EraseMethod · 0.45

Tested by 12

TearDownMethod · 0.68
TearDownMethod · 0.68
TearDownMethod · 0.68
TEST_FFunction · 0.68
TearDownMethod · 0.68
TEST_FFunction · 0.68
TESTFunction · 0.68
TEST_FFunction · 0.68
TearDownMethod · 0.68
TEST_FFunction · 0.68
TearDownMethod · 0.68
TEST_FFunction · 0.68