public void listen() {
    	SSLSocket s = null;
        SSLServerSocket serverSocket = null;
    	try {
            System.out.println(DropboxConstants.SERVER_PORT);
        	//serverSocket = new ServerSocket(DropboxConstants.SERVER_PORT);
            serverSocket = (SSLServerSocket)this.sslserversocketfactory.createServerSocket(DropboxConstants.SERVER_PORT);
        	while(true) {
                try {
                    s = (SSLSocket) serverSocket.accept();
                    
                    String ip = s.getInetAddress().getHostAddress();
                    if(!this.clientkeys.containsKey(ip)) {
                        System.out.println("A new client comes in, pick up keys for him");
                        Keys keys = this.clientKeyQueue.poll();
                        this.clientkeys.put(ip, keys);
                    }
                    PublicKey pubKey = this.clientkeys.get(ip).keyPair.getPublic();
                    SecretKey encryptionKey = this.clientkeys.get(ip).secretKey;
                    SynchronizationService service = new SynchronizationService(s, pubKey, encryptionKey);
                    threadService.submit(service);
                }
                catch(Exception ex) {
                    System.out.println("Socket Error or File Processing Error!");
                    Logger.getLogger(DropboxServer.class.getName()).log(Level.SEVERE, null, ex);
                }
        	}
       }
       catch(IOException ex) {
           System.out.println("DropboxConstants.SERVER_PORT has already in use");
           Logger.getLogger(DropboxServer.class.getName()).log(Level.SEVERE, null, ex);
        }
        finally {
            try {
                if(serverSocket != null)
                    serverSocket.close();
                if(s != null)
                    s.close();
           } catch (IOException ex) {
                Logger.getLogger(DropboxServer.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }