public void handshake() throws Exception {
		generateHash();
		sendHandshakeMessage("hash:" + clientInfo.hashID);
		sendHandshakeMessage("username:" + clientInfo.username);
		sendHandshakeMessage("ipaddress:" + clientConnection.getLocalAddress().toString());
		sendHandshakeMessage("port:" + Integer.toString(clientConnection.getLocalPort()));

		String raw_message = "";
		String[] token = new String[3];
		
		while(true) {
			while(incoming.ready()) {
				raw_message = incoming.readLine();
				token = raw_message.split(":");
				if(token[0].equals("hash")) {
					clientInfo.remoteHash = token[1];
				} else if(token[0].equals("username")) {
					clientInfo.remoteUsername = token[1];
				} else if(token[0].equals("ipaddress")) {
					clientInfo.remoteIP = token[1];
				} else if(token[0].equals("port")) {
					clientInfo.remotePort = token[1];
				} else {
					break;
				}
			}
			if(clientInfo.remoteUsername.length() != 0 && clientInfo.remoteIP.length() != 0 && clientInfo.remoteHash.length() != 0) {
				break;
			}
		}
	}