| 134 | } |
| 135 | } |
| 136 | void LocalPC::sendAsyn(const int& him, Util::MemoryFrame packet) |
| 137 | { |
| 138 | processIncomingPackets(); |
| 139 | |
| 140 | if(!shd->peer[him].isOccupied()) |
| 141 | return; |
| 142 | |
| 143 | INTERLOCKED; |
| 144 | // push the packet on target's packetqueue |
| 145 | PeerData &peerData = shd->peer[him]; |
| 146 | int slotIndex = peerData.incomingCount++; |
| 147 | if(slotIndex >= 16) |
| 148 | { |
| 149 | DropMessage(1, "stacked 16 packets, no space"); |
| 150 | return; |
| 151 | } |
| 152 | if(packet.size() > 508) |
| 153 | { |
| 154 | DropMessage(1, "packet bigger than 508 bytes (%d), being cut", packet.size()); |
| 155 | } |
| 156 | Util::MemoryFrame::from(peerData.incoming[slotIndex].data).write(packet); |
| 157 | peerData.incoming[slotIndex].length = packet.size(); |
| 158 | peerData.incoming[slotIndex].sender = self; |
| 159 | } |
| 160 | void LocalPC::receive() |
| 161 | { |
| 162 | processIncomingPackets(); |
no test coverage detected