Gnutella Forums

Gnutella Forums (https://www.gnutellaforums.com/)
-   Feature Requests & Bug Reports (https://www.gnutellaforums.com/feature-requests-bug-reports/)
-   -   [Feature Request] Connect to different UP-vendors (https://www.gnutellaforums.com/feature-requests-bug-reports/82013-feature-request-connect-different-up-vendors.html)

arne_bab January 27th, 2009 04:35 AM

Hi ToNneTje,

Quote:

Originally Posted by ToNneTje (Post 337169)
"Do you build your Phex from subversion?"

I haven't build anything, i'm not an expert :(

Since you're using GNU/Linux, you don't need to be :)

Which distribution do you use?
(you need subversion, everything else should already be in place)

ToNneTje January 27th, 2009 04:46 AM

I'm using Ubuntu 8.10.

But even build Phex from subversion sounds difficult to me :(

(Maybe i must spend some time to learn stuff like that)

arne_bab January 27th, 2009 06:28 AM

It really isn't hard :)

You just need to open a terminal and do the following few steps.

First step: Getting subversion (for downloading the code) and maven (to build phex):

Code:

sudo apt-get install subversion maven2
Second step: Getting the phex code:

Code:

svn co https://phex.svn.sourceforge.net/svnroot/phex/phex/trunk phex
Third step: Building and Running Phex:


Code:

cd phex
./build-and-run

That's it, you can now always run the bleeding edge version of Phex via

Code:

svn update ; ./build-and-run
:)

To now change Phex to always prefer Phex, just open the following file from the phex folder in your text editor and change the section I named in the earlier post:

src/main/java/phex/host/CaughtHost.java

And you can run ./build-and-run to run it.

Voilą, your own modified Phex version :)

ToNneTje January 27th, 2009 06:48 AM

Thanks alot, i will try to do this tonight.

:xeri_ok1ani:

arne_bab January 27th, 2009 09:12 AM

Happy sharing!

ToNneTje January 27th, 2009 01:38 PM

@Arne

It works, i can now edit CaughtHost.java :xeri_ok1ani:

But... do i need to change 3 time False into True ?
Or do i have to delete if ( avgDailyUptime < 7200 ) ?

And Ubuntu has installed OpenJDK after i follow your instructions and now the program isn't look very well.
I was using Sun Java... can i uninstall OpenJDK or is it necessary ?

Thanks.

T.

arne_bab January 28th, 2009 12:07 AM

Great!

You should be able to use sun-jdk (I use it on my Gentoo box):

Code:

sudo apt-get install sun-java6-jdk
The package is in multiverse, though: Ubuntu -- Package Search Results -- sun-java6-jdk


In the Phex code, you can just comment out the avgDailyUptime if clause. Commenting out in Java can be done by writing "/*" before the part and "*/" after the part,for example like this:

Code:

    public boolean isDecentPhexHost()
    {
        if ( !StringUtils.equals( vendor, "PHEX" ) )
        {
            return false;
        }
/*
        if ( avgDailyUptime < 7200 )
        {
            return false;
        }
*/
        if ( !isUltrapeer )
        {
            return false;
        }
        return true;
    }


Besides: What this code does:
* The first if clause checks if the other one is a Phex
* The second checks if it has high uptime (decent client)
* The third checks if it is an ultrapeer

Only if all three are fullfilled, the host is called "decent Phex", and Phex preferences decent Phex'.

By commenting out the second if clause, you preference all Phex ultrapeers. If you'd comment out the second and third, you'd also preference Phex leaves (which doesn't help you get connections and might even render your Phex unable to find Ultrapeers).

All this applies only for the connections your program starts. Incoming connections have no preferencing.

arne_bab January 28th, 2009 12:20 AM

PS: I just adapted this thread to turn it into a guide in our development section: http://www.gnutellaforums.com/develo...ntu-linux.html

ricoil July 22nd, 2009 04:36 PM

Quote:

Originally Posted by arne_bab (Post 337221)
All this applies only for the connections your program starts. Incoming connections have no preferencing.

Where must the code be modified in order to introduce preferencing in Incoming connections as well?

arne_bab July 22nd, 2009 11:03 PM

I think you might have to add a new comparision feature to incoming connections. It will have to decide, if it wants to drop a working connection when it gets a new incoming one, and that code can get quite complicated (including a setting to reserve slots for other vendors to make sure that Phex doesn't isolate itself - or a setting to only grant at most 2/3rd of the slots to a specific vendor or similar to avoid isolation in a single-vendor-island).

I'm not perfectly sure about the right place, but the OIOServer looks fitting: https://phex.svn.sourceforge.net/svn...OIOServer.java

Gregor should know that better...


All times are GMT -7. The time now is 12:04 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.