Esempio n. 1
0
        public ClientConnection OpenActiveConnection(string networkDeviceName)
        {
            string[] address = networkDeviceName.Split(':');

            string host;
            int port;
            if (address.Length == 1)
                port = defaultPort;
            else if (address.Length == 2)
                port = int.Parse(address[1]);
            else
                throw new System.ArgumentException("Invalid parameters for creation of the channel.");

            host = address[0];

            return new WebSocketClientConnection(host, port, timeout);
        }
Esempio n. 2
0
        public ClientConnection OpenActiveConnection(string networkDeviceName)
        {
            string[] address = networkDeviceName.Split(':');

            string host;
            int    port;

            if (address.Length == 1)
            {
                port = defaultPort;
            }
            else if (address.Length == 2)
            {
                port = int.Parse(address[1]);
            }
            else
            {
                throw new System.ArgumentException("Invalid parameters for creation of the channel.");
            }

            host = address[0];

            return(new WebSocketClientConnection(host, port, timeout));
        }
Esempio n. 3
0
 public WebSocketChannelManager(string hostname, int defaultPort, int timeout)
 {
     this.host        = new WebSocketDevice(defaultPort, hostname);
     this.defaultPort = defaultPort;
     this.timeout     = timeout;
 }
Esempio n. 4
0
 public WebSocketChannelManager(string hostname, int defaultPort, int timeout)
 {
     this.host = new WebSocketDevice(defaultPort, hostname);
     this.defaultPort = defaultPort;
     this.timeout = timeout;
 }