public void receiveMsg(){
		try {
			InputStream is = socket.getInputStream();
			ObjectInputStream ois = new ObjectInputStream(is);
			Object newObj = ois.readObject();
			if (newObj instanceof ClientModel) {
				// Always perform add when ClientModel receive to update client information
				ClientModel client = (ClientModel) newObj;
				// remove old object
				if(!server.clientList.isEmpty()){
					ArrayList<ClientModel> deleteList = new ArrayList<ClientModel>();
					for(ClientModel cm : server.clientList){
						// distinguish clients by port number
						if(cm.port == client.port){
//							server.clientList.remove(cm);
							deleteList.add(cm);
						}
					}
					server.clientList.removeAll(deleteList);
				}
	
			    server.clientList.add(client);
			    System.out.println("Client information is stored in server");
			    System.out.println(client.toString());
			} else if (newObj instanceof String) {
				String filename = (String) newObj;
				System.out.println("Start to find file: "+filename);
				ArrayList<ClientModel> targets = server.find(filename);
				if(targets.isEmpty()||targets==null){
					System.out.println("No result found: "+filename);
				}
				// Send the result back
				OutputStream os = socket.getOutputStream();
				ObjectOutputStream oos = new ObjectOutputStream(os); 
				oos.writeObject(targets);  
				oos.close();  
				os.close();  
			} 
			ois.close();
			is.close();
			socket.close();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}