public override bool SendMessage(IMessage message) { if (client.isConnected) { return(client.Send(MessageMgr.PackMessage(message, useBigEndian))); } return(false); }
private void onReceive(TcpClient client, byte[] bytes) { var message = MessageMgr.UnpackMessage(bytes, useBigEndian); if (message != null) { MessageMgr.DispatchMessage(message); } }
private void SendHeartbeat() { var message = MessageMgr.CreateMessage(hearbeatOpcode); if (message != null) { SendMessage(message); } }