public IEnumerator StartServer(string configPath, string version = "0.01") { CleanupClient(); string configStr = ReadFile(configPath); AsyncIO.ForceDotNet.Force(); status = ClientStatus.QuerySent; client = new RequestSocket(); client.Connect($"{this.server_address}:{this.server_port}"); SetupMessage setupMessage = new SetupMessage(configStr: configStr); yield return(StartCoroutine(this.SendRequest(JsonConvert.SerializeObject(new VersionedRequest(setupMessage, RequestType.setup, version))))); }
//_______________________________________________________________________ //_______________________________________________________________________ // Public Methods #region public IEnumerator StartServer(string configPath, string version = "0.01", bool isPath = true) { reply = null; if (tcpConnection == null) { ConnectServer(); } yield return(new WaitUntil(() => tcpConnection != null)); string configStr; if (isPath) { configStr = ReadFile(configPath); } else { configStr = configPath; } SetStatus(ClientStatus.QuerySent); SetupMessage setupMessage = new SetupMessage(configStr: configStr); yield return(StartCoroutine(this.SendRequest(JsonConvert.SerializeObject(new VersionedRequest(setupMessage, RequestType.setup, version))))); }