public Manager(Uri uri, Options opts) { if (opts == null) { opts = new Options(); } if (opts.Path == null) { opts.Path = "/socket.io"; } this.Opts = opts; this.Nsps = ImmutableDictionary.Create <string, Socket>(); this.Subs = new ConcurrentQueue <On.IHandle>(); this.Reconnection(opts.Reconnection); this.ReconnectionAttempts(opts.ReconnectionAttempts != 0 ? opts.ReconnectionAttempts : int.MaxValue); this.ReconnectionDelay(opts.ReconnectionDelay != 0 ? opts.ReconnectionDelay : 1000); this.ReconnectionDelayMax(opts.ReconnectionDelayMax != 0 ? opts.ReconnectionDelayMax : 5000); this.Timeout(opts.Timeout < 0 ? 20000 : opts.Timeout); this.ReadyState = ReadyStateEnum.CLOSED; this.Uri = uri; this.Attempts = 0; this.Encoding = false; this.PacketBuffer = new List <Parser.Packet>(); this.OpeningSockets = new HashSet <Socket>(); this.Encoder = new Parser.Parser.Encoder(); this.Decoder = new Parser.Parser.Decoder(); this.AutoConnect = opts.AutoConnect; if (AutoConnect) { Open(); } }
public Manager(Uri uri, Options opts) { LogManager.GetLogger(Global.CallerName("", 0, "")).Info("Init Manager: " + (object)uri); if (opts == null) { opts = new Options(); } if (opts.Path == null) { opts.Path = "/socket.io"; } this.Opts = (Quobject.EngineIoClientDotNet.Client.Socket.Options)opts; this.Nsps = ImmutableDictionary.Create <string, QSocket>(); this.Subs = new ConcurrentQueue <ClientOn.IHandle>(); this.Reconnection(opts.Reconnection); this.ReconnectionAttempts(opts.ReconnectionAttempts != 0 ? opts.ReconnectionAttempts : int.MaxValue); this.ReconnectionDelay(opts.ReconnectionDelay != 0L ? opts.ReconnectionDelay : 1000L); this.ReconnectionDelayMax(opts.ReconnectionDelayMax != 0L ? opts.ReconnectionDelayMax : 5000L); this.Timeout(opts.Timeout < 0L ? 20000L : opts.Timeout); this.ReadyState = Manager.ReadyStateEnum.CLOSED; this.Uri = uri; this.Attempts = 0; this.Encoding = false; this.PacketBuffer = new List <Packet>(); this.OpeningSockets = new HashSet <QSocket>(); this.Encoder = new Quobject.SocketIoClientDotNet.Parser.Parser.Encoder(); this.Decoder = new Quobject.SocketIoClientDotNet.Parser.Parser.Decoder(); this.AutoConnect = opts.AutoConnect; if (!this.AutoConnect) { return; } this.Open(); }
public Engine(Uri uri, Quobject.EngineIoClientDotNet.Client.Socket.Options opts) : base(uri, opts) { }
public Manager(Uri uri, Options opts) { if (opts == null) { opts = new Options(); } if (opts.Path == null) { opts.Path = "/socket.io"; } this.Opts = opts; this.Nsps = ImmutableDictionary.Create<string, Socket>(); this.Subs = new Queue<On.IHandle>(); this.Reconnection(opts.Reconnection); this.ReconnectionAttempts(opts.ReconnectionAttempts != 0 ? opts.ReconnectionAttempts : int.MaxValue); this.ReconnectionDelay(opts.ReconnectionDelay != 0 ? opts.ReconnectionDelay : 1000); this.ReconnectionDelayMax(opts.ReconnectionDelayMax != 0 ? opts.ReconnectionDelayMax : 5000); this.Timeout(opts.Timeout < 0 ? 20000 : opts.Timeout); this.ReadyState = ReadyStateEnum.CLOSED; this.Uri = uri; this.Connected = 0; this.Attempts = 0; this.Encoding = false; this.PacketBuffer = new List<Parser.Packet>(); this.Encoder = new Parser.Parser.Encoder(); this.Decoder = new Parser.Parser.Decoder(); this.AutoConnect = opts.AutoConnect; if (AutoConnect) { Open(); } }