private WebSocket createSocket( String scheme, String userInfo, String host, int port, String path, String query, int timeout) throws IOException { // True if 'scheme' is 'wss' or 'https'. boolean secure = isSecureConnectionRequired(scheme); // Check if 'host' is specified. if (host == null || host.length() == 0) { throw new IllegalArgumentException("The host part is empty."); } // Determine the path. path = determinePath(path); // Create a Socket instance and a connector to connect to the server. SocketConnector connector = createRawSocket(host, port, secure, timeout); // Create a WebSocket instance. return createWebSocket(secure, userInfo, host, port, path, query, connector); }
private WebSocket createSocket( String scheme, String userInfo, String host, int port, String path, String query, int timeout) throws IOException { // True if 'scheme' is 'wss' or 'https'. boolean secure = isSecureConnectionRequired(scheme); // Check if 'host' is specified. if (host == null || host.length() == 0) { throw new IllegalArgumentException("The host part is empty."); } // Determine the path. path = determinePath(path); // Create a Socket instance and a connector to connect to the server. SocketConnector connector = createRawSocket(host, port, secure, timeout); // Create a WebSocket instance. return createWebSocket(secure, userInfo, host, port, path, query, connector); }