Package javax.net

Examples of javax.net.SocketFactory.createSocket()


            public Object run() throws IOException {
                SocketFactory sf = SocketFactory.getDefault();
                InetSocketAddress sockAddr = new InetSocketAddress(
                        slaveAddress.getHostAddress(),
                        slaveAddress.getPortNumber());
                Socket s_temp = sf.createSocket();
                s_temp.connect(sockAddr, timeout_);
                return s_temp;
            }
        });
       
View Full Code Here


      int localPort, HttpConnectionParams params) throws IOException,
      UnknownHostException, ConnectTimeoutException {
    int timeout = QQConstants.HTTP_TIME_OUT;
    SocketFactory socketfactory = getSSLContext().getSocketFactory();
    if (timeout == 0) {
      return socketfactory.createSocket(host, port, localAddress,
          localPort);
    } else {
      Socket socket = socketfactory.createSocket();
      SocketAddress localaddr = new InetSocketAddress(localAddress,
          localPort);
View Full Code Here

    SocketFactory socketfactory = getSSLContext().getSocketFactory();
    if (timeout == 0) {
      return socketfactory.createSocket(host, port, localAddress,
          localPort);
    } else {
      Socket socket = socketfactory.createSocket();
      SocketAddress localaddr = new InetSocketAddress(localAddress,
          localPort);
      SocketAddress remoteaddr = new InetSocketAddress(host, port);
      socket.bind(localaddr);
      socket.connect(remoteaddr, timeout);
View Full Code Here

            throw new IllegalArgumentException("Parameters may not be null");
        }
        int timeout = connParams.getConnectionTimeout();
        SocketFactory socketfactory = sslContext.getSocketFactory();
        if (timeout == 0) {
            return socketfactory.createSocket(host, port, localHost, localPort);
        } else {
            Socket socket = socketfactory.createSocket();
            SocketAddress localaddr = new InetSocketAddress(localHost, localPort);
            SocketAddress remoteaddr = new InetSocketAddress(host, port);
            socket.bind(localaddr);
View Full Code Here

        int timeout = connParams.getConnectionTimeout();
        SocketFactory socketfactory = sslContext.getSocketFactory();
        if (timeout == 0) {
            return socketfactory.createSocket(host, port, localHost, localPort);
        } else {
            Socket socket = socketfactory.createSocket();
            SocketAddress localaddr = new InetSocketAddress(localHost, localPort);
            SocketAddress remoteaddr = new InetSocketAddress(host, port);
            socket.bind(localaddr);
            socket.connect(remoteaddr, timeout);
            return socket;
View Full Code Here

   {
      Socket s = null;
      SocketFactory socketFactory = getSocketFactory();
      if (socketFactory != null)
      {
         s = socketFactory.createSocket();
      }
      else
      {
          s = new Socket();
      }
View Full Code Here

        super.setUp();
    }

    protected Socket createSocket(URI connectUri) throws IOException {
        SocketFactory factory = SSLSocketFactory.getDefault();
        return factory.createSocket("127.0.0.1", connectUri.getPort());
    }
}
View Full Code Here

                // Get a server socket
                socket = ServerSocketHolder.getSocket(port, 1);
            } else {
                // Get a client socket (the factory will connect it)
                SocketFactory sf = SocketFactory.getDefault();
                socket = sf.createSocket(host, port);
            }
        }
        catch (IOException ioe) {
            // This will grab UnknownHostException, too.
            throw new TransportException(ioe);
View Full Code Here

        final SocketFactory sslSocketFactory = SSLHelper.getInstanceByKey(serverHostname, serverPort, caTop).getSocketFactory();
       
        // Create the SSLSocket
        //
        final SSLSocket sslSocket =
                (SSLSocket)sslSocketFactory.createSocket(host, port);
       
        // Set the SSLSocket Enabled Cipher Suites
        //
        final String enabledCipherSuites =
                java.lang.System.getProperty("javax.rmi.ssl.client.enabledCipherSuites");
View Full Code Here

            SocketFactory socketfactory = sslContext.getSocketFactory();
            int connectTimeout = params.getConnectionTimeout();

            if (connectTimeout == 0) {
                return socketfactory.createSocket(host, port, localAddress, localPort);
            } else {
                Socket socket = socketfactory.createSocket();
                SocketAddress localSocketAddress = new InetSocketAddress(localAddress, localPort);
                SocketAddress remoteSocketAddress = new InetSocketAddress(host, port);
                socket.bind(localSocketAddress);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.