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