private bool SendNext(object sender, Packet packet) { lock (PacketWriter) { PacketWriter.Clear(); PacketWriter.Write(packet); return(Send(PacketWriter)); } }
public bool SendNext(params Packet[] packets) { lock (PacketWriter) { PacketWriter.Clear(); foreach (var packet in packets) { PacketWriter.Write(packet); } return(Send(PacketWriter)); } }