public ServerSocket bind() throws IOException, GeneralSecurityException, ConfigurationException {
  if (useSSL) {
    SSLSocketFactoryGenerator sslFactoryGenerator=new SSLSocketFactoryGenerator(this.keystoreAlias,this.securityInfo);
    SSLServerSocketFactory sslserverSocketFactory=sslFactoryGenerator.getSSLServerSocketFactory();
    serverSocket=(SSLServerSocket)sslserverSocketFactory.createServerSocket();
  }
 else {
    ServerSocketChannel serverChannel=ServerSocketChannel.open();
    serverSocket=serverChannel.socket();
  }
  serverSocket.setReuseAddress(true);
  serverSocket.bind(address);
  serverSocket.setSoTimeout(acceptTimeout);
  return serverSocket;
}

public ServerSocket bind ( ) throws IOException , GeneralSecurityException , ConfigurationException { if ( useSSL ) { SSLSocketFactoryGenerator sslFactoryGenerator = new SSLSocketFactoryGenerator ( this . keystoreAlias , this . securityInfo ) ; SSLServerSocketFactory sslserverSocketFactory = sslFactoryGenerator . getSSLServerSocketFactory ( ) ; serverSocket = ( SSLServerSocket ) sslserverSocketFactory . createServerSocket ( ) ; } else { ServerSocketChannel serverChannel = ServerSocketChannel . open ( ) ; serverSocket = serverChannel . socket ( ) ; } serverSocket . setReuseAddress ( true ) ; serverSocket . bind ( address ) ; serverSocket . setSoTimeout ( acceptTimeout ) ; return serverSocket ; }
connect to the server socket .
