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 a ServerSocket at the specified host name and the
        //port number.
        return   (ServerSocket) AccessController.doPrivileged
            (new PrivilegedExceptionAction() {
            public Object run() throws IOException, StandardException {
                ServerSocketFactory sf = ServerSocketFactory.getDefault();
                return sf.createServerSocket(slaveAddress.getPortNumber(),
                    0, slaveAddress.getHostAddress());
            }
        });
    }
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

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

            next.start();

            ServerSocket serverSocket;
            try {
                if (secure) {
                    ServerSocketFactory factory = SSLServerSocketFactory.getDefault();
                    serverSocket = factory.createServerSocket(port, backlog, address);
                    final String[] enabledCipherSuites = { "SSL_DH_anon_WITH_RC4_128_MD5" };
                    ((SSLServerSocket) serverSocket).setEnabledCipherSuites(enabledCipherSuites);
                } else {
                    serverSocket = new ServerSocket(port, backlog, address);
                }
View Full Code Here

   protected ServerSocket createServerSocket(int serverBindPort,
                                             int backlog,
                                             InetAddress bindAddress) throws IOException
   {
      ServerSocketFactory factory = getServerSocketFactory();
      ServerSocket ss = null;
     
      try
      {
         ss = factory.createServerSocket();
      }
      catch (SocketException e)
      {
         if (getReuseAddress())
            log.warn("Unable to create unbound ServerSocket: cannot set reuseAddress to true",e);
         ss = factory.createServerSocket(serverBindPort, backlog, bindAddress);
         configureServerSocket(ss);
         return ss;
      }
     
      ss.setReuseAddress(getReuseAddress());
View Full Code Here

      return ss;
   }
  
   protected void createServerSockets() throws IOException
   {
      ServerSocketFactory factory = getServerSocketFactory();

      Iterator it = getHomes().iterator();
      while (it.hasNext())
      {
         Home home = (Home) it.next();
         InetAddress inetAddress = InetAddress.getByName(home.host);
         ServerSocket ss = null;

         try
         {
            ss = factory.createServerSocket();
            ss.setReuseAddress(getReuseAddress());
            configureServerSocket(ss);
            InetSocketAddress address = new InetSocketAddress(inetAddress, home.port);
            ss.bind(address, backlog);
            if (log.isDebugEnabled()) log.debug(this + " created " + ss);
         }
         catch (SocketException e)
         {
            if (getReuseAddress())
               log.warn("Unable to create unbound ServerSocket: cannot set reuseAddress to true",e);

            try
            {
               ss = factory.createServerSocket(home.port, backlog, inetAddress);
               configureServerSocket(ss);
            }
            catch (IOException e2)
            {
               String m = this + " error creating ServerSocket[" + home + "]: " + e2.getMessage();
View Full Code Here

     * @throws java.io.IOException due to factory creation problems
     */
    private ServerSocketFactory getFactory()
  throws SSLKeyException
    {
        ServerSocketFactory factory;
        factory = ((null != context) ?
                   context.getServerSocketFactory() :
                   // make best effort to obtain a factory
                   SSLServerSocketFactory.getDefault());
 
View Full Code Here

        ServerSocket ss = null;
        try {
            ss = AccessController.doPrivileged
            (new PrivilegedExceptionAction<ServerSocket>() {
                public ServerSocket run() throws IOException  {
                    ServerSocketFactory sf = ServerSocketFactory.getDefault();
                    return sf.createServerSocket(slaveAddress.getPortNumber(),
                            0, slaveAddress.getHostAddress());
                }
            });
            return ss;
        } catch(PrivilegedActionException pea) {
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

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.