public void Receive() { //while (true) //{ IncomingPacket incomingPacket; while (incomingPackets.TryDequeue(out incomingPacket)) { PacketUtil.HandleGroup( incomingPacket.data, incomingPacket.length, (byte[] _data, int _len) => { OnReceived(_data, _len); } ); } //} }
public void Receive() { //while (true) //{ IncomingPacket incomingPacket; while (incomingPackets.TryDequeue(out incomingPacket)) { PacketUtil.HandleGroup( incomingPacket.data, incomingPacket.length, (byte[] _data, int _len) => { OnReceived(clients[incomingPacket.peerID], _data, _len); } ); receiveBufferPool.Return(incomingPacket.data); } //} }