protected override void OnResolve(UvArgs <IPEndPoint[]> args) { if (!this.Check(args)) { return; } _endpoints = args.Data; this.Connect(this.GetNextEndPoint()); }
protected override void OnConnect(UvArgs args) { if (this.Status == HandleStatus.Open) { this.SendPacket(); } else { this.Close(); } }
protected override void OnClose(UvArgs args) { if (!this.Check(args)) { return; } try { if (_callback != null) { _callback.Invoke(new UvWebClientGetArgs(null, this.GetResponse())); } } finally { this.Dispose(); } }
protected override void OnConnect(UvArgs args) { if (!args.Successful) { var endpoint = this.GetNextEndPoint(); if (endpoint != null) { this.Connect(endpoint); return; } } if (!this.Check(args)) { return; } this.Write(Encoding.UTF8.GetBytes(this.GetRequest())); }
protected bool Check(UvArgs args) { if (args.Successful) { return(true); } try { if (_callback != null) { _callback.Invoke(new UvWebClientGetArgs(args.Exception)); } } finally { this.Dispose(); } return(false); }
protected override void OnClose(UvArgs args) { Console.WriteLine("Client disconnected"); base.OnClose(args); }
protected override void OnClose(UvArgs args) { args.Throw(); }
protected override void OnOpen(UvArgs args) { args.Throw(); this.Read(); }
protected override void OnOpen(UvArgs args) { args.Throw(); this.Write(Encoding.UTF8.GetBytes(_data)); }
protected override void OnResolve(UvArgs<IPEndPoint[]> args) { if(!this.Check(args)) return; _endpoints = args.Data; this.Connect(this.GetNextEndPoint()); }
protected override void OnConnect(UvArgs args) { if(!args.Successful) { var endpoint = this.GetNextEndPoint(); if(endpoint != null) { this.Connect(endpoint); return; } } if (!this.Check(args)) return; this.Write(Encoding.UTF8.GetBytes(this.GetRequest())); }
protected override void OnClose(UvArgs args) { if (!this.Check(args)) return; try { if (_callback != null) _callback.Invoke(new UvWebClientGetArgs(null, this.GetResponse())); } finally { this.Dispose(); } }
protected bool Check(UvArgs args) { if (args.Successful) return true; try { if (_callback != null) _callback.Invoke(new UvWebClientGetArgs(args.Exception)); } finally { this.Dispose(); } return false; }
protected override void OnConnect(UvArgs args) { if (this.Status == HandleStatus.Open) this.SendPacket(); else this.Close(); }