MCPcopy Create free account
hub / github.com/amule-project/amule / NextPacketToSocket

Method NextPacketToSocket

src/ExternalConn.cpp:2711–2729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2709}
2710
2711void ECNotifier::NextPacketToSocket()
2712{
2713 for(std::map<CECServerSocket *, ECUpdateMsgSource **>::iterator i = m_msg_source.begin();
2714 i != m_msg_source.end(); ++i) {
2715 CECServerSocket *sock = i->first;
2716 if ( sock->HaveNotificationSupport() && !sock->DataPending() ) {
2717 ECUpdateMsgSource **notifier_array = i->second;
2718 // Same ownership contract as WriteDoneAndQueueEmpty: the
2719 // CECPacket from GetNextPacket is caller-owned and
2720 // SendPacket only serialises it. Wrap so it's freed at
2721 // scope exit (#765).
2722 CSmartPtr<CECPacket> packet(GetNextPacket(notifier_array));
2723 if (packet) {
2724 //printf("[EC] sending update packet; opcode=%x\n",packet->GetOpCode());
2725 sock->SendPacket(packet.get());
2726 }
2727 }
2728 }
2729}
2730
2731// File_checked_for_headers

Callers

nothing calls this directly

Calls 6

DataPendingMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
SendPacketMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected