public bool Connect(IPAddress address) { if (!_client.Connect(address)) { return(false); } _client.SendMessage(new Message { Code = MessageCode.CONNECT, Body = new ByteArrayWriter().Append(Protocol.VERSION).Array }); return(true); }
public void Send(Message message) { if (!Connected) { return; } _client.SendMessage(message); if (Connected) { Shake(); } else { ConnectedUser.Id = -1; } }