public void Send(Core.Networking.OutPacket outPacket) { try { byte[] sendBuffer = outPacket.BuildEncrypted(); socket.BeginSend(sendBuffer, 0, sendBuffer.Length, SocketFlags.None, new AsyncCallback(SendCallback), null); } catch { Disconnect(); } }
public void Append(OutPacket p) { byte[] packetBuffer = p.BuildEncrypted(); if (buffer.Length == 0) { buffer = packetBuffer; } else { Array.Resize(ref buffer, buffer.Length + packetBuffer.Length); Array.Copy(packetBuffer, 0, buffer, buffer.Length - packetBuffer.Length, packetBuffer.Length); } }