/*
@Override
public ServerSocketBar openUnixServerSocket(PathImpl unixPath)
throws IOException
{
ServerSocketBar ss = ServerSocketJni.createPath(unixPath);

return ss;
}
432436
@Override
  public SocketBar connect(SocketBar socket,
                           InetSocketAddress addressRemote,
                           InetSocketAddress addressLocal,
                           long connectTimeout,
                           boolean isSSL)
    throws IOException
  {
    try {
      JniSocketImpl jniSocket = null;
      
      if (socket instanceof JniSocketImpl) {
        jniSocket = (JniSocketImpl) socket;
      }

      if (JniSocketImpl.isEnabled() && ! isSSL) {
        jniSocket = JniSocketImpl.connect(jniSocket,
                                          addressRemote.getAddress().getHostAddress(),
                                          addressRemote.getPort());
      }

      if (jniSocket != null) {
        return jniSocket;
      }
    } catch (Exception e) {
      e.printStackTrace();
      log.finer(e.toString());
    }

    return super.connect(socket, addressRemote, addressLocal, connectTimeout, isSSL);
  }
505478
SocketInterface createSocket(@NonNull final String token, @NonNull final WeakReference<SocketStateListener> stateListenerWeakReference) {

        WebSocket socket = null;

        WebSocketFactory factory = new WebSocketFactory();

        // Configure proxy if provided
        if (proxyAddress != null) {
            ProxySettings settings = factory.getProxySettings();
            settings.setServer(proxyAddress);
        }

        try {
            socket = factory.createSocket(uri, TIMEOUT);
        } catch (IOException e) {
            log.f("Creating socket failed", e);
        }

        if (socket != null) {

            String header = AuthManager.AUTH_PREFIX + token;
            socket.addHeader("Authorization", header);

            socket.addListener(createWebSocketAdapter(stateListenerWeakReference));

            socket.setPingInterval(PING_INTERVAL);

            return new SocketWrapperImpl(socket);
        }

        return null;
    }
868202
function socketClient(serviceUrl) {
  var self = object.create(socketClient.prototype);
  var urlObject = url.parse(serviceUrl);

  // create the url without the path
  var socketIoUrl = url.format({
    protocol: urlObject.protocol,
    hostname: urlObject.hostname
  });

  var options = {
    reconnection: true,
    reconnectionDelay: 1000,
    reconnectionDelayMax: 50000,
    reconnectionAttempts: 5,
    autoConnect: false,
    path: url.clearTraliningSlash(urlObject.path) + '/socket.io/'
  };

  self.socket = io(socketIoUrl, options);
  self.opened = false;

  return self;
}
1134999
public function connectUnix($path)
    {
        $this->type = 'unix';

        if (!$this->bevConnectEnabled) {
            $fd = socket_create(AF_UNIX, SOCK_STREAM, 0);
            if (!$fd) {
                return false;
            }
            socket_set_nonblock($fd);
            @socket_connect($fd, $path, 0);
            $this->setFd($fd);
            return true;
        }
        $this->bevConnect = true;
        $this->addr = 'unix:' . $path;
        $this->setFd(null);
        return true;
    }
95664
@Override
  public ServerSocketBar bind(ServerSocketBar ss)
    throws ConfigException, IOException, GeneralSecurityException
  {
    throw new ConfigException(L.l("jsse is not allowed here"));
  }
1057099
@Override
    public URLConnection openConnection(URL url) throws IOException {
        if (url.getPath() == null || url.getPath().trim().length() == 0) {
            throw new MalformedURLException("Path can not be null or empty. Syntax: " + SYNTAX );
        }
        bpmnXmlURL = new URL(url.getPath());

        logger.log(Level.FINE, "BPMN xml URL is: [" + bpmnXmlURL + "]");
        return new Connection(url);
    }
792765
@Override
    public Socket createSocket(String host, int port) throws IOException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "SocketFactory attempting to create socket for host: " + host + " port: " + port);

        // check for SSL addresses
        if (Util.isEncodedHost(host, HOST_PROTOCOL)) {
            String sslConfigName = Util.decodeHostInfo(host);
            host = Util.decodeHost(host);
            return createSSLSocket(host, (char) port, sslConfigName);
        } else {
            return createPlainSocket(host, port);
        }
    }
248068
def connect_unix
    D "opening connection to #{@socket_path}..."
    s = Timeout.timeout(@open_timeout) { UNIXSocket.open(@socket_path) }
    D "opened"
    @socket = BufferedIO.new(s)
    @socket.read_timeout = @read_timeout
    @socket.continue_timeout = @continue_timeout
    @socket.debug_output = @debug_output
    on_connect
  end
1086457
public static UNIXSocket newStrictInstance() throws IOException {
	final UNIXSocketImpl impl = new UNIXSocketImpl();
	UNIXSocket instance = new UNIXSocket(impl);
	instance.impl = impl;
	return instance;
    }
1114191
public PathImpl fsWalk(String userPath,
                        Map<String,Object> attributes,
                        String path)
  {
    return new ClasspathPath(_root, userPath, path);
  }
1294302
public static WrapSeekable<FSDataInputStream> openPath(
		FileSystem fs, Path p) throws IOException
	{
		return new WrapSeekable<FSDataInputStream>(
			fs.open(p), fs.getFileStatus(p).getLen(), p);
	}
342130
@Override
  public ClientSocket open()
  {
    State state = _state;
    
    if (! state.isInit())
      return null;

    ClientSocket stream = openRecycle();

    if (stream != null)
      return stream;

    return connect();
  }
1297863
@Override
    public Session connectToServer(Object clazz, URI path) throws DeploymentException, IOException {

        if (clazz == null || path == null) {
            throw new IllegalArgumentException();
        }
        ClientConnector x = new ClientConnector();
        return x.connectAnnotatedClass(clazz, path, this);
    }
818310
private ServerCommandID createServerCommand(String command) throws IOException {
        FileInputStream fis = null;
        BufferedReader reader = null;

        try {
            fis = new FileInputStream(commandFile);
            reader = new BufferedReader(new InputStreamReader(fis));
            String line = reader.readLine();
            if (line == null)
                line = "";

            return new ServerCommandID(line, command);
        } finally {
            if (!Utils.tryToClose(reader)) {
                Utils.tryToClose(fis);
            }
        }
    }
713809
void createImpl() throws SocketException {
        if (impl == null)
            setImpl();
        try {
            impl.create(true);
            created = true;
        } catch (IOException e) {
            throw new SocketException(e.getMessage());
        }
    }
333090
public static ServerSocketBar createJNI(InetAddress host, int port)
    throws IOException
  {
      return currentFactory().create(host, port, 0, true);
  }
1201544
@Override
    public Session connectToServer(Class<? extends Endpoint> endpointClass, ClientEndpointConfig endpointConfig, URI path) throws DeploymentException, IOException {

        Object theObject = null;

        if (endpointClass == null || path == null) {
            throw new IllegalArgumentException();
        }

        if (!(Endpoint.class.isAssignableFrom(endpointClass))) {
            DeploymentException e = new DeploymentException("Class " + endpointClass.getName() + " does not extend Endpoint");
            String msg = Tr.formatMessage(tc, "client.invalid.endpointclass", endpointClass.toString(), e.getMessage());
            Tr.error(tc, "client.invalid.endpointclass", endpointClass.toString(), e.getMessage());
            throw new DeploymentException(msg, e);
        }

        ClientConnector x = new ClientConnector();

        try {
            theObject = getEndpointInstance(endpointClass);
        } catch (DeploymentException e) {
            String msg = Tr.formatMessage(tc, "client.connection.error", endpointClass.toString(), e.getMessage());
            Tr.error(tc, "client.connection.error", endpointClass.toString(), e.getMessage());
            throw new DeploymentException(msg, e);
        }

        return x.connectClass(theObject, path, endpointConfig, this);
    }