MCPcopy Create free account
hub / github.com/cuberite/cuberite / CleanUpShutSockets

Method CleanUpShutSockets

src/OSSupport/SocketThreads.cpp:637–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635
636
637void cSocketThreads::cSocketThread::CleanUpShutSockets(void)
638{
639 cCSLock Lock(m_Parent->m_CS);
640 for (int i = m_NumSlots - 1; i >= 0; i--)
641 {
642 switch (m_Slots[i].m_State)
643 {
644 case sSlot::ssShuttingDown2:
645 {
646 // The socket has reached the shutdown timeout, close it and clear its slot:
647 m_Slots[i].m_Socket.CloseSocket();
648 m_Slots[i] = m_Slots[--m_NumSlots];
649 break;
650 }
651 case sSlot::ssShuttingDown:
652 {
653 // The socket has been shut down for a single thread loop, let it loop once more before closing:
654 m_Slots[i].m_State = sSlot::ssShuttingDown2;
655 break;
656 }
657 default: break;
658 }
659 } // for i - m_Slots[]
660}
661
662
663

Callers

nothing calls this directly

Calls 1

CloseSocketMethod · 0.45

Tested by

no test coverage detected