MCPcopy Create free account
hub / github.com/bwapi/bwapi / processIncomingPackets

Method processIncomingPackets

bwapi/SNP_DirectIP/SNP/LocalPC.cpp:49–74  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

47
48 //------------------------------------------------------------------------------------------------------------------------------------
49 void LocalPC::processIncomingPackets()
50 {
51 INTERLOCKED;
52 try
53 {
54 // mark our slot
55 shd->peer[self].lastOccupied = GetTickCount();
56
57 // pass all packets to storm
58 /*int incomingCount = shd->peer[self].incomingCount;
59 if(incomingCount > 16)
60 incomingCount = 16;*/
61 for(int i = 0; i < shd->peer[self].incomingCount; i++)
62 {
63 Packet &packet = shd->peer[self].incoming[i];
64 passPacket(packet.sender, Util::MemoryFrame(packet.data, packet.length));
65 }
66
67 // clear incoming queue
68 shd->peer[self].incomingCount = 0;
69 }
70 catch(GeneralException &e)
71 {
72 DropLastError("processIncomingPackets failed: %s", e.getMessage());
73 }
74 }
75 //------------------------------------------------------------------------------------------------------------------------------------
76 //------------------------------------------------------------------------------------------------------------------------------------
77 void LocalPC::initialize()

Callers

nothing calls this directly

Calls 4

passPacketFunction · 0.85
MemoryFrameClass · 0.85
DropLastErrorFunction · 0.85
getMessageMethod · 0.80

Tested by

no test coverage detected