Ejemplo 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);
        }
Ejemplo 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));
        }
Ejemplo n.º 3
0
 public WebSocketChannelManager(string hostname, int defaultPort, int timeout)
 {
     this.host        = new WebSocketDevice(defaultPort, hostname);
     this.defaultPort = defaultPort;
     this.timeout     = timeout;
 }
Ejemplo n.º 4
0
 public WebSocketChannelManager(string hostname, int defaultPort, int timeout)
 {
     this.host = new WebSocketDevice(defaultPort, hostname);
     this.defaultPort = defaultPort;
     this.timeout = timeout;
 }