protected override void DoPoll() { LogManager.GetLogger(Global.CallerName("", 0, "")).Info("xhr DoPoll"); this.sendXhr = this.Request(new PollingXHR.XHRRequest.RequestOptions() { CookieHeaderValue = this.Cookie }); this.sendXhr.On(Transport.EVENT_DATA, (IListener) new PollingXHR.DoPollEventDataListener(this)); this.sendXhr.On(Transport.EVENT_ERROR, (IListener) new PollingXHR.DoPollEventErrorListener(this)); this.sendXhr.Create(); }
protected PollingXHR.XHRRequest Request(PollingXHR.XHRRequest.RequestOptions opts) { if (opts == null) { opts = new PollingXHR.XHRRequest.RequestOptions(); } opts.Uri = this.Uri(); opts.ExtraHeaders = this.ExtraHeaders; PollingXHR.XHRRequest xhrRequest = new PollingXHR.XHRRequest(opts); xhrRequest.On(Transport.EVENT_REQUEST_HEADERS, (IListener) new PollingXHR.EventRequestHeadersListener(this)).On(Transport.EVENT_RESPONSE_HEADERS, (IListener) new PollingXHR.EventResponseHeadersListener(this)); return(xhrRequest); }
protected override void DoWrite(byte[] data, ActionTrigger action) { PollingXHR.XHRRequest.RequestOptions opts = new PollingXHR.XHRRequest.RequestOptions() { Method = "POST", Data = data, CookieHeaderValue = this.Cookie }; LogManager.GetLogger(Global.CallerName("", 0, "")).Info("DoWrite data = " + (object)data); this.sendXhr = this.Request(opts); this.sendXhr.On(Transport.EVENT_SUCCESS, (IListener) new PollingXHR.SendEventSuccessListener(action)); this.sendXhr.On(Transport.EVENT_ERROR, (IListener) new PollingXHR.SendEventErrorListener(this)); this.sendXhr.Create(); }