public bool send(NetPacketV1 packet) { if (packet == null) { return(false); } if (!this.isConnected()) { return(false); } MemoryStream ms = new MemoryStream(); if (!packet.serialize(ref ms)) { return(false); } try { SocketError success = SocketError.Success; int num = this.socket_.Send(ms.GetBuffer(), 0, (int)ms.Length, SocketFlags.None, out success); if (success != SocketError.Success) { return(false); } if (num != ms.Length) { return(false); } } catch (Exception) { return(false); } return(true); }