public void Send(uint packetId, IDataSerializer packet) { Packet pck = GetPacket(packetId); pck.WritePacket(packet); Send(pck); DataStreamPool.Return(pck.Stream); }
public void ReturnWriter(PacketWriter writer) { DataStreamPool.Return(writer.NetworkStream); DataStreamPool.Return(writer.PacketStream); }
public Packet GetPacket(uint id, IDataSerializer packet) { return(GetPacket(id, DataStreamPool.Take(), packet)); }
public PacketWriter TakeWriter() { var writer = new PacketWriter(DataStreamPool.Take(), DataStreamPool.Take()); return(writer); }
public Packet GetPacket(uint id) { return(GetPacket(id, DataStreamPool.Take())); }