Beispiel #1
0
        /// <summary>
        /// Constructor to create a SocketManager instance.
        /// </summary>
        public SocketManager(Uri uri, IParser parser, SocketOptions options)
        {
            this.Context = new LoggingContext(this);

            string path = uri.PathAndQuery;

            if (path.Length <= 1)
            {
                string append;
                if (uri.OriginalString[uri.OriginalString.Length - 1] == '/')
                {
                    append = "socket.io/";
                }
                else
                {
                    append = "/socket.io/";
                }

                uri = new Uri(uri.OriginalString + append);
            }

            this.Uri           = uri;
            this.Options       = options ?? new SocketOptions();
            this.State         = States.Initial;
            this.PreviousState = States.Initial;
            this.Parser        = parser ?? new DefaultJsonParser();
        }
Beispiel #2
0
 public SocketManager(Uri uri, SocketOptions options)
     : this(uri, new DefaultJsonParser(), options)
 {
 }