private Transport CreateTransport(string name) { Dictionary <string, string> dictionary = new Dictionary <string, string>((IDictionary <string, string>) this.Query); dictionary.Add("EIO", Quobject.EngineIoClientDotNet.Parser.Parser2.Protocol.ToString()); dictionary.Add("transport", name); if (this.Id != null) { dictionary.Add("sid", this.Id); } Transport.Options options = new Transport.Options(); options.Hostname = this.Hostname; options.Port = this.Port; options.Secure = this.Secure; options.Path = this.Path; options.Query = dictionary; options.TimestampRequests = this.TimestampRequests; options.TimestampParam = this.TimestampParam; options.PolicyPort = this.PolicyPort; options.Socket = this; options.Agent = this.Agent; options.ForceBase64 = this.ForceBase64; options.ForceJsonp = this.ForceJsonp; options.Cookies = this.Cookies; options.ExtraHeaders = this.ExtraHeaders; if (name == WebSocket.NAME) { return((Transport) new WebSocket(options)); } if (name == Polling.NAME) { return((Transport) new PollingXHR(options)); } throw new EngineIOException("CreateTransport failed"); }
protected Transport(Transport.Options options) { this.Path = options.Path; this.Hostname = options.Hostname; this.Port = options.Port; this.Secure = options.Secure; this.Query = options.Query; this.TimestampParam = options.TimestampParam; this.TimestampRequests = options.TimestampRequests; this.Socket = options.Socket; this.Agent = options.Agent; this.ForceBase64 = options.ForceBase64; this.ForceJsonp = options.ForceJsonp; this.Cookie = options.GetCookiesAsString(); this.ExtraHeaders = options.ExtraHeaders; }