/// <summary> /// Only the Id is written asynchronously!! /// </summary> public async Task SendPacketAsync(Packet packet) { await WriteByteAsync(packet.Id); WriteInt((int) packet.Size); packet.WritePacket(this); //PacketSent(this, new PacketEventArgs(this, packet)); }
public void SendPacket(Packet packet) { if (packet == null) return; WriteByte(packet.Id); WriteInt((int)packet.Size); packet.WritePacket(this); //PacketSent(this, new PacketEventArgs(this, packet)); }