public void handshake() throws Exception {
		String raw_message = "";
		String[] token = new String[3];
		generateHash();

		while(true) {
			while(incoming.ready()) {
				raw_message = incoming.readLine();
				token = raw_message.split(":");
				if(token[0].equals("hash")) {
					sendHandshakeMessage("hash:" + serverInfo.hashID);
					serverInfo.remoteHash = token[1];
				} else if(token[0].equals("username")) {
					sendHandshakeMessage("username:" + serverInfo.username);
					serverInfo.remoteUsername = token[1];
				} else if(token[0].equals("ipaddress")) {
					sendHandshakeMessage("ipaddress:" + serverConnection.getInetAddress().toString());
					serverInfo.remoteIP = token[1];
				} else if(token[0].equals("port")) {
					sendHandshakeMessage("port:" + Integer.toString(serverConnection.getLocalPort()));
					serverInfo.remotePort = token[1];
				} else break;
			}
			
			if(serverInfo.remoteUsername.length() != 0 && serverInfo.remoteIP.length() != 0 && serverInfo.remoteHash.length() != 0) {
				break;
			}
		}
	}