Exemplo n.º 1
0
        public WebSocket(string url)
        {
            if (!WebSocketFactory.isInitialized)
            {
                WebSocketFactory.Initialize();
            }

            int instanceId = WebSocketFactory.WebSocketAllocate(url);

            WebSocketFactory.instances.Add(instanceId, this);

            this.instanceId = instanceId;
        }
Exemplo n.º 2
0
        public WebSocket(string url, Dictionary <string, string> headers = null)
        {
            if (!WebSocketFactory.isInitialized)
            {
                WebSocketFactory.Initialize();
            }

            int instanceId = WebSocketFactory.WebSocketAllocate(url);

            WebSocketFactory.instances.Add(instanceId, this);

            this.instanceId = instanceId;
        }
Exemplo n.º 3
0
        public WebSocket(string url, List <string> subprotocols, Dictionary <string, string> headers = null)
        {
            if (!WebSocketFactory.isInitialized)
            {
                WebSocketFactory.Initialize();
            }

            int instanceId = WebSocketFactory.WebSocketAllocate(url);

            WebSocketFactory.instances.Add(instanceId, this);

            foreach (string subprotocol in subprotocols)
            {
                WebSocketFactory.WebSocketAddSubProtocol(instanceId, subprotocol);
            }

            this.instanceId = instanceId;
        }