| 663 | |
| 664 | |
| 665 | void 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 |
nothing calls this directly
no test coverage detected