public PerformURLGET ( bool async, String url ) : void | ||
async | bool | True if this request should be asynchronous. |
url | String | The URL. |
리턴 | void |
/// <summary> /// Validate the session. /// </summary> /// <param name="failOnError">True if an exception should be thrown on error.</param> public void ValidateSession(bool failOnError) { int max; if (failOnError) { max = 1; } else { max = 5; } for (int i = 0; i < max; i++) { CloudRequest request = new CloudRequest(); request.PerformURLGET(false, this.session); if ("success".Equals(request.Status)) { return; } } if (failOnError) { throw new EncogCloudError("Connection lost"); } }
/// <summary> /// Logout of the specified session. /// </summary> public void Logout() { CloudRequest request = new CloudRequest(); request.PerformURLGET(false, this.session + "logout"); this.session = null; }
/// <summary> /// Stop this task. /// </summary> /// <param name="finalStatus">The final status for this task.</param> public void Stop(String finalStatus) { if (this.taskURL == null) { throw new EncogCloudError("Can't stop inactive task."); } // send final status CloudRequest request = new CloudRequest(); String url = this.taskURL + "update"; IDictionary <String, String> args = new Dictionary <String, String>(); args["status"] = finalStatus; request.PerformURLPOST(false, url, args); // stop url = this.taskURL + "stop"; request = new CloudRequest(); request.PerformURLGET(false, url); }
/// <summary> /// Validate the session. /// </summary> /// <param name="failOnError">True if an exception should be thrown on error.</param> public void ValidateSession(bool failOnError) { int max; if (failOnError) { max = 1; } else { max = 5; } for (int i = 0; i < max; i++) { CloudRequest request = new CloudRequest(); request.PerformURLGET(false, this.session); if ("success".Equals(request.Status)) { return; } } if (failOnError) { throw new EncogCloudError("Connection lost"); } }
/// <summary> /// Logout of the specified session. /// </summary> public void Logout() { CloudRequest request = new CloudRequest(); request.PerformURLGET(false, this.session + "logout"); this.session = null; }
/// <summary> /// Stop this task. /// </summary> /// <param name="finalStatus">The final status for this task.</param> public void Stop(String finalStatus) { if (this.taskURL == null) { throw new EncogCloudError("Can't stop inactive task."); } // send final status CloudRequest request = new CloudRequest(); String url = this.taskURL + "update"; IDictionary<String, String> args = new Dictionary<String, String>(); args["status"] = finalStatus; request.PerformURLPOST(false, url, args); // stop url = this.taskURL + "stop"; request = new CloudRequest(); request.PerformURLGET(false, url); }