public void Write(byte[] data) { try { StreamUtil.Write(GetStream(), data); } catch (Exception e) { Close(); onDisconnect?.Invoke(this, e.Message); } }
public void Send(NetworkStream stream) { StreamUtil.Write(stream, GetBytes()); }