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

Method QueueOutgoingData

src/OSSupport/SocketThreads.cpp:665–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663
664
665void cSocketThreads::cSocketThread::QueueOutgoingData(void)
666{
667 cCSLock Lock(m_Parent->m_CS);
668 for (int i = 0; i < m_NumSlots; i++)
669 {
670 if (m_Slots[i].m_Client != NULL)
671 {
672 AString Data;
673 m_Slots[i].m_Client->GetOutgoingData(Data);
674 m_Slots[i].m_Outgoing.append(Data);
675 }
676 if (m_Slots[i].m_Outgoing.empty())
677 {
678 // No outgoing data is ready
679 if (m_Slots[i].m_State == sSlot::ssWritingRestOut)
680 {
681 // The socket doesn't want to be kept alive anymore, and doesn't have any remaining data to send.
682 // Shut it down and then close it after a timeout, or when the other side agrees
683 m_Slots[i].m_State = sSlot::ssShuttingDown;
684 m_Slots[i].m_Socket.ShutdownReadWrite();
685 }
686 continue;
687 }
688 }
689}
690
691
692

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.80
ShutdownReadWriteMethod · 0.80
GetOutgoingDataMethod · 0.45

Tested by

no test coverage detected