I am writing a c# gnutella client. I have written classes for connecting and routing messages but am having trouble connecting to some clients and maintaining connections for others.
Limewire *always* gives me a 503 service unavailable message when I try and connect. (Though I can connect to a copy running on my local machine provided all of its connections slots aren't being used.) I am guessing that if you want to connect to limewire hosts you must pretend to be one of them. Do other gnutella clients use this approach? How difficult is it to do? Is it just a case of sending an appropriate User-Agent header or would you be forced to implement other limewire specific functionality?
Bearshare clients accept incoming connections. 2.x tends to stay alive for something like a hundred messages before sending me a Bye message with an error code of 503 and no error text. Version 4 clients tend to keep connections alive for much longer. Gnucleus and some other clients allow me to connect but tend to disconnect after around a dozen messages.
I am hoping that there is someone out there who can shed some light on why I am finding it so difficult to maintain these connections.
For initial node discovery I have implemented gwebcache. Once I get some x-try headers then I use those instead. Whenever I establish a connection then I use Ping/Pong messages to find new nodes. Is this an appropriate algorithm for node discovery? How beneficial and difficult would it be to implement ultranode functionality?
In summary my problem is that I am droping connections faster than I can make them and can only get at most three or four concurrent connections even though I have ten streams concurrently trying to establish them. Any assistance would be much appreciated.
I am also looking for collaborators. Please contact me if you would like to contribute.
Regards
Jake Mitchell
gnutrinoNOSPAM@PLEASEhotmail.com [remove NOSPAMPLEASE]