@Override
	public void run() {
		try {
			System.out.println("run it!");
			input = getBufferedReader(client.getInputStream());
			output = getPrintStream(client.getOutputStream());
			
			System.out.println("Stream it!");
			
			hello(user.getUsername(), Server.GLOBAL_SUPPORTS, "0.1");
			
			System.out.println("Handshake gestuurd!");
			
			Command handshake = new Command(input, true);
			System.out.println("Handshake ontvangen!");
			if (!handshake.getCommand().equals(ClientProtocol.HANDSHAKE)) {
				throw new ProtocolException("No handshake received", 1); //TODO
			}
			System.out.println("Handshake OK!");
			while (true) {
				handlePacket(new Command(input, true));
			}
			
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ProtocolException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}