public static void main(String args[]){
		int portNumber = 1500;
		String serverAddress = "localhost";
		String username = "Anonymous";
		
		switch(args.length){
			case 3:
				serverAddress = args[2];
			case 2:
				try{
					portNumber = Integer.parseInt(args[1]);
				}
				catch(Exception e){
					System.out.println("Invalid port number");
					System.out.println("Usage is: > java Client [username] [portNumber] [serverAddress]");
					return;
				}
			case 1:
				username = args[0];
			case 0:
				break;
			default:
				System.out.println("Usage is java Client [username] [portNumber] [serverAddress]");
				return;
		}
		
		Client client = new Client(serverAddress, portNumber, username);
		
		if(!client.start())
			return;
		
		Scanner scan= new Scanner(System.in);
		while(true){
			System.out.print("> ");
			String msg = scan.nextLine();
			if(msg.equalsIgnoreCase("LOGOUT")){
				client.sendMessage(new ChatMessage(ChatMessage.LOGOUT, ""));
				break;
			}
			else if(msg.equalsIgnoreCase("WHOISIN")){
				client.sendMessage(new ChatMessage(ChatMessage.WHOISIN, ""));
			}
			else{
				client.sendMessage(new ChatMessage(ChatMessage.MESSAGE, msg));
			}
		}
		client.disconnect();
	}