Package javax.net

Examples of javax.net.ServerSocketFactory


                                           
        // Create the right kind of socket
        switch (getSSLMode()) {
        case SSL_OFF:
        default:
            ServerSocketFactory sf =
                ServerSocketFactory.getDefault();
            return sf.createServerSocket(portNumber
                                         ,0,
                                         hostAddress);
        case SSL_BASIC:
            SSLServerSocketFactory ssf =
                (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
View Full Code Here


                     
    // Create the right kind of socket
    switch (getSSLMode()) {
    case SSL_OFF:
    default:
      ServerSocketFactory sf =
        ServerSocketFactory.getDefault();
      return sf.createServerSocket(portNumber
                     ,0,
                     hostAddress);
    case SSL_BASIC:
      SSLServerSocketFactory ssf =
        (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
View Full Code Here

            System.setProperty("javax.net.ssl.keyStore", path);
            System.setProperty("javax.net.ssl.keyStorePassword", password);
            System.setProperty("javax.net.ssl.trustStore", path);
            System.setProperty("javax.net.ssl.trustStorePassword", password);

            ServerSocketFactory server = SSLServerSocketFactory.getDefault();
            // Let the operating system just choose an available port:
            ServerSocket serverSocket = server.createServerSocket(0);
            serverSocket.setSoTimeout(30000);
            int port = serverSocket.getLocalPort();
            // System.out.println("\nlistening on port: " + port);

            SSLSocketFactory ssf = SSLSocketFactory.getSocketFactory();
View Full Code Here

     */
    public static void main(String[] args) throws Exception {
        AWSCredentials fakeAwsCredentials = new AWSCredentials("fake-aws-access-key", "fake-aws-secret-key");
       
        int port = 443;
        ServerSocketFactory ssocketFactory = SSLServerSocketFactory.getDefault();
        ServerSocket ssocket = ssocketFactory.createServerSocket(port);
        System.out.println("Accepting connections on port 443");
   
        while (port == 443) {
            // Listen for connections
            Socket socket = ssocket.accept();
View Full Code Here

            System.setProperty("javax.net.ssl.keyStore", path);
            System.setProperty("javax.net.ssl.keyStorePassword", password);
            System.setProperty("javax.net.ssl.trustStore", path);
            System.setProperty("javax.net.ssl.trustStorePassword", password);

            ServerSocketFactory server = SSLServerSocketFactory.getDefault();
            // Let the operating system just choose an available port:
            ServerSocket serverSocket = server.createServerSocket(0);
            serverSocket.setSoTimeout(30000);
            int port = serverSocket.getLocalPort();
            // System.out.println("\nlistening on port: " + port);

            SSLSocketFactory ssf = SSLSocketFactory.getSocketFactory();
View Full Code Here

    public SimpleSSLSocketFactory() {
        super();
    }
   
    public ServerSocket createServerSocket(int port) throws IOException {
        ServerSocketFactory socketfactory = getSSLContext().getServerSocketFactory();
        return socketfactory.createServerSocket(port);
    }
View Full Code Here

            System.setProperty("javax.net.ssl.keyStore", path);
            System.setProperty("javax.net.ssl.keyStorePassword", password);
            System.setProperty("javax.net.ssl.trustStore", path);
            System.setProperty("javax.net.ssl.trustStorePassword", password);

            ServerSocketFactory server = SSLServerSocketFactory.getDefault();
            // Let the operating system just choose an available port:
            ServerSocket serverSocket = server.createServerSocket(0);
            serverSocket.setSoTimeout(30000);
            int port = serverSocket.getLocalPort();
            // System.out.println("\nlistening on port: " + port);

            SSLSocketFactory ssf = SSLSocketFactory.getSocketFactory();
View Full Code Here

                     
    // Create the right kind of socket
    switch (getSSLMode()) {
    case SSL_OFF:
    default:
      ServerSocketFactory sf =
        ServerSocketFactory.getDefault();
      return sf.createServerSocket(portNumber
                     ,0,
                     hostAddress);
    case SSL_BASIC:
      SSLServerSocketFactory ssf =
        (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
View Full Code Here

         SocketFactory sf = (SocketFactory) getSocketFactoryConstructor().newInstance(new Object[]{new Integer(5000), new Integer(1)});
         clientConfig.put(Remoting.CUSTOM_SOCKET_FACTORY, sf);
      }
      else
      {
         ServerSocketFactory ssf = (ServerSocketFactory) getServerSocketFactoryConstructor().newInstance(new Object[]{new Integer(5000), new Integer(-1)});
         clientConfig.put(Remoting.CUSTOM_SERVER_SOCKET_FACTORY, ssf);
      }
      addExtraClientConfig(clientConfig);
      Client client = new Client(clientLocator, clientConfig);
      client.connect();
View Full Code Here

         config.put(Bisocket.PING_FREQUENCY, "11111111");        
      }
      if (setWriteTimeout)
      {
         config.put(SocketWrapper.WRITE_TIMEOUT, writeTimeout);
         ServerSocketFactory ssf = (ServerSocketFactory) getServerSocketFactoryConstructor().newInstance(new Object[]{new Integer(blockingTime), new Integer(initialWrites)});
         config.put(Remoting.CUSTOM_SERVER_SOCKET_FACTORY, ssf);
      }
      if (setCallbackWriteTimeout)
      {
         config.put(SocketWrapper.WRITE_TIMEOUT, writeTimeout);
View Full Code Here

TOP

Related Classes of javax.net.ServerSocketFactory

Copyright © 2018 www.massapicom. 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.