Gnutella Forums

Gnutella Forums (https://www.gnutellaforums.com/)
-   General Gnutella Development Discussion (https://www.gnutellaforums.com/general-gnutella-development-discussion/)
-   -   Handshake not working (https://www.gnutellaforums.com/general-gnutella-development-discussion/30069-handshake-not-working.html)

GSt November 16th, 2004 05:37 AM

Handshake not working
 
hi

i'm writing a small gnutella client, but up till now can't even establish a connection, because the other peer always responds with
Code:

GNUTELLA/0.6 500 Invalid Handshake
i'm developing my client using java, what i'm sending to the other peer as handshake is

Code:

GNUTELLA CONNECT/0.6\r\n
User-Agent: test/0.1\r\n
\r\n

the java code i'm using to send it is

Code:

String msg = "";
msg += "GNUTELLA CONNECT/0.6\r\n";
msg += "User-Agent: test/0.1\r\n";
msg += "\r\n";
                       
outputStream.write(msg.getBytes(), 0, msg.getBytes().length);
outputStream.flush();

i already studied the 0.6 protocol spec, read tbrough various forums and had a look at the open source client phex, but i can't figure out what's wrong with my handshake, phex is doing exactly the same.

please help, thanks

arne_bab November 16th, 2004 01:53 PM

Hi,

Ich kann selbst noch nicht programmieren, sondern habe mich immer auf der theoretischen Ebene mit Gnutella beschäftigt. Trotzdem habe ich mich gerade etwas im Phex Quellcode umgesehen.

Die Header, die du schickst sind extrem minimal, sollten aber eigentlich funktionieren. Hast du dein Programm an einem lokalen Programm getestet, das Ultrapeer fähigkeiten aktiviert hat?

Ansonsten kann es nämlich leicht sein, dass du an ein Blatt (Leaf-Node) geraten bist, das keinerlei eigehende Verbindungen annimmt.

Zur Sicherheit solltest du es mit Phex versuchen, und in den Prefs unter Verbindungen peer-verbindungen aktivieren.

Phex schickt außerdem noch den Header
LISTEN_IP
mit.
Schreib mir bitte, wie es weiterging!

Was planst du, mit dem Programm zu machen?
Wieso nimmst du nicht eifnach Code von Phex?

GregorK November 17th, 2004 02:56 AM

Phex should accept this handshake if there are peer slots open.

Other clients will most likely reject it since Phex is one of the rare clients left that still support peer connections and handshakes without the ultrapeer headers. I think we even support incoming 0.4 handshakes...
Though the peer and 0.4 handshake is not tested well, since its not used anymore. It could be that your connection is not very reliable.

BTW: Phex has no 500 return code.

Gregor

GSt November 17th, 2004 04:28 AM

you are right ! it was the ultrapeers headers that seemingly the other peer did not like

concerning the 500 error code: i didn't test it with phex, but bearshare

thank you for your help !

arne_bab November 17th, 2004 06:26 AM

Bearshare will most probably reject your connection. No Bearshare-Leaf should ever connect outside the Bearshare-cluster.

Bearshare UPs accept some other leafs...


All times are GMT -7. The time now is 03:37 PM.

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.