Gnutella Forums

Gnutella Forums (http://www.gnutellaforums.com/)
-   Development Open Discussion (http://www.gnutellaforums.com/development-open-discussion/)
-   -   [Wanted] Simple Phex API Tutorial - how to do a search? (http://www.gnutellaforums.com/development-open-discussion/93153-wanted-simple-phex-api-tutorial-how-do-search.html)

2eXtreme August 4th, 2009 11:26 PM

[Wanted] Simple Phex API Tutorial - how to do a search?
 
Hi Guys,

I've posted in another thread, but I've deiced I like Phex best, out of all my attempted routes at Gnutella development.

The thing is, I'd really love a tutorial on how to do a simple search with the Phex API?

When I say simple, I'm hoping for only a few classes to be used, with the code something like:

Code:

//Main.java

public class Main{

public static void main(String [] args){
new Main(args);
}

public Main(String [] items){
if (items.length == 1){
new Search(items[0]);
}
}
}

//Search.java

public class Search{
public Search(String searchForThis){
//Connect to Gnutella
//Search network for search term
//Calls a method that adds files to result list
addResult(fileN);
//after network has been searched
System.out.println("Finished searching!");
}
public void addResult(File myFile){
//adds a file to an array list of files
myResults.add(myFile);
System.out.println("Found: " +myFile.getName());
}
}

//File.java
public class File{
public String getName(){
return this.name;
}
//other members
}


arne_bab January 14th, 2010 01:06 AM

Something like this would be useful to me, too.

How to do basic tasks in Phex.

We can get javadocs via calling

Code:

mvn javadoc:javadoc
in the subversion repo: http://www.phex.org/wiki/index.php/B...rom_Subversion

But that's a pretty lowlevel description, so it would be nice to have a higher level description (also for the jython commandline UI I want to do):

* How can we start a search cleanly - and get the results?
* How can I add a connection by IP:PORT?
* How can I tell Phex to connect/disconnect the network?
* How can I start a download by magnet or search result?

Related: Our wiki has a page with some additional info on what a GUI needs from an API: http://www.phex.org/wiki/index.php/C...m_a_backend.3F

PS: Sorry that I didn't answer earlier. I couldn't answer the question, so I decided to avoid muddlign things up. On hidnsight I don't think that that decision was overly clever, but I can't change it now...

hustnn February 28th, 2010 11:31 PM

about the API
 
If I want to develop a gnutella client from scratch< I think the gnutella should be a standard and it shuold be not related the concept implementation such as limewire and phex.

So if i want to develope it follow the protocol standard, then it should can work with limrework and phex clients.

So,where can I find the related toturial or protocol document of this?


All times are GMT -7. The time now is 01:27 PM.

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

Copyright 2020 Gnutella Forums.
All Rights Reserved.