Example #1
0
File: IO.cs Project: cs130-w21/13
        public static QSocket Socket(Uri uri, IO.Options opts)
        {
            LogManager logger = LogManager.GetLogger(Global.CallerName("", 0, ""));

            if (opts == null)
            {
                opts = new IO.Options();
            }
            Manager manager;

            if (opts.ForceNew || !opts.Multiplex)
            {
                logger.Info(string.Format("ignoring socket cache for {0}", (object)uri.ToString()));
                manager = new Manager(uri, (Quobject.SocketIoClientDotNet.Client.Options)opts);
            }
            else
            {
                string id = Url.ExtractId(uri);
                if (!IO.Managers.ContainsKey(id))
                {
                    logger.Info(string.Format("new io instance for {0}", (object)id));
                    IO.Managers.Add(id, new Manager(uri, (Quobject.SocketIoClientDotNet.Client.Options)opts));
                }

                manager = IO.Managers[id];
            }

            return(manager.Socket(uri.PathAndQuery));
        }
Example #2
0
File: IO.cs Project: cs130-w21/13
 public static QSocket Socket(string uri, IO.Options opts)
 {
     return(IO.Socket(Url.Parse(uri), opts));
 }