Examples of SocketFactory


Examples of org.apache.http.conn.scheme.SocketFactory

    private final static void setup() {

        // Register the "http" protocol scheme, it is required
        // by the default operator to look up socket factories.
        supportedSchemes = new SchemeRegistry();
        SocketFactory sf = PlainSocketFactory.getSocketFactory();
        supportedSchemes.register(new Scheme("http", sf, 80));

        // Prepare parameters.
        // Since this example doesn't use the full core framework,
        // only few parameters are actually required.
View Full Code Here

Examples of org.apache.http.conn.scheme.SocketFactory

        supportedSchemes = new SchemeRegistry();

        // Register the "http" and "https" protocol schemes, they are
        // required by the default operator to look up socket factories.
        SocketFactory sf = PlainSocketFactory.getSocketFactory();
        supportedSchemes.register(new Scheme("http", sf, 80));
        sf = SSLSocketFactory.getSocketFactory();
        supportedSchemes.register(new Scheme("https", sf, 80));

        // prepare parameters
View Full Code Here

Examples of org.apache.http.conn.scheme.SocketFactory

    private final static void setup() {

        // Register the "http" and "https" protocol schemes, they are
        // required by the default operator to look up socket factories.
        supportedSchemes = new SchemeRegistry();
        SocketFactory sf = PlainSocketFactory.getSocketFactory();
        supportedSchemes.register(new Scheme("http", sf, 80));
        sf = SSLSocketFactory.getSocketFactory();
        supportedSchemes.register(new Scheme("https", sf, 80));

        // Prepare parameters.
View Full Code Here

Examples of org.apache.http.io.SocketFactory

        return new TestSuite(TestHttpHost.class);
    }

    protected void setUp() throws Exception {
        super.setUp();
        SocketFactory socketfactory = PlainSocketFactory.getSocketFactory();
        final Scheme http = new Scheme("http", socketfactory, 80);
        Scheme.registerScheme("http", http);
    }
View Full Code Here

Examples of org.apache.http.io.SocketFactory

        }
        assertNotOpen();
        if (this.targethost == null) {
          throw new IllegalStateException("Target host not specified");
        }
        SocketFactory socketfactory = this.targethost.getScheme().getSocketFactory();
        Socket socket = socketfactory.createSocket(
                this.targethost.getHostName(), this.targethost.getPort(),
                this.localAddress, 0,
                params);
        bind(socket, params);
    }
View Full Code Here

Examples of org.codehaus.spice.netserve.sockets.SocketFactory

    }

    public void testDefault()
        throws Exception
    {
        final SocketFactory csf = new DefaultSocketFactory();
        final ServerSocketFactory ssf = new DefaultServerSocketFactory();

        doSocketPairTest( csf, ssf );
    }
View Full Code Here

Examples of org.jacorb.orb.factory.SocketFactory

        {
            try
            {
                IIOPAddress address = (IIOPAddress)addressIterator.next();

                final SocketFactory factory =
                    (use_ssl) ? getSSLSocketFactory() :
                    getSocketFactory();

                final String ipAddress = address.getIP();
                final int port = (use_ssl) ? ssl_port : address.getPort();
                if (ipAddress.indexOf(':') == -1)
                {
                    connection_info = ipAddress + ":" + port;
                }
                else
                {
                    connection_info = "[" + ipAddress + "]:" + port;
                }

                if (logger.isDebugEnabled())
                {
                    logger.debug("Trying to connect to " + connection_info + " with timeout=" + time_out + ( use_ssl ? " using SSL." : "."));
                }
                exception = null;

                if( time_out > 0 )
                {
                    final int truncatedTimeout = (int) time_out;
                    if (truncatedTimeout != time_out)
                    {
                        logger.warn("timeout might be changed due to conversion from long to int. old value: " + time_out + " new value: " + truncatedTimeout);
                    }
                    socket = factory.createSocket(ipAddress, port, truncatedTimeout);
                }
                else
                {
                    //no timeout --> may hang forever!
                    socket = factory.createSocket(ipAddress, port);
                }
            }
            catch (Exception e)
            {
                exception = e;
View Full Code Here

Examples of org.jgroups.util.SocketFactory

    private void init(TP transport) {
        TransportConfiguration transportConfig = this.configuration.getTransport();
        SocketBinding binding = transportConfig.getSocketBinding();
        if (binding != null) {
            SocketFactory factory = transport.getSocketFactory();
            if (!(factory instanceof ManagedSocketFactory)) {
                transport.setSocketFactory(new ManagedSocketFactory(factory, binding.getSocketBindings()));
            }
        }
        ThreadFactory threadFactory = transportConfig.getThreadFactory();
View Full Code Here

Examples of sunlabs.brazil.util.SocketFactory

  throws IOException, UnknownHostException
    {
  this.host = host;
  this.port = port;

  SocketFactory socketFactory = HttpRequest.socketFactory;
  if (socketFactory == null) {
      socketFactory = SocketFactory.defaultFactory;
  }

  sock = socketFactory.newSocket(host, port);
  in = new BufferedInputStream(sock.getInputStream());
  out = new BufferedOutputStream(sock.getOutputStream());

  serial = count++;
    }
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.