public void connect() throws IOException, Exception{

                if (isDownloadPassive()){
                        //creating a listener for current client
                        ServerSocket localListener = new ServerSocket(0);
                        setLocalAddress("127.0.0.1"); //TODO: determine IP from server socket
                        setLocalPort(localListener.getLocalPort());

                        hubComm.sendDataToHub("$ConnectToMe "+getRemoteUsername()+" "+getLocalAddress()+":"+getLocalPort()+"|");
                        String response = hubComm.getHubData();

                        //accepting the connecting of the remote client and creating
                        //the connection between the two
                        setConnection(new Connection(localListener.accept()));
                        localListener.close();
                }else{
                        //TODO: find out how to connect non passively.
                }
        }