Gnutella Forums

Gnutella Forums (https://www.gnutellaforums.com/)
-   General Gnutella Development Discussion (https://www.gnutellaforums.com/general-gnutella-development-discussion/)
-   -   Message Problems (https://www.gnutellaforums.com/general-gnutella-development-discussion/60706-message-problems.html)

beat August 31st, 2006 05:19 AM

Message Problems
 
hi. i´m interessted in the Gnutella Protocol and i´m doing my first steps with programming it. But i have a problem. when the handshake connection is established (it works cause i get a GNUTTELLA CONNECT OK... from der server servent) i´m trying to send a ping, hoping to receive a pong. But nothing happens. I cannot find errors in my code. Sb please help me.

Code:

import java.io.*;
import java.net.*;

public class Test {
        public static void main (String[] args) throws IOException{

                byte[] ping = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x10,0x11,0x13,
                                          0x14,0x0A,0x0B,0x0C,0x0D,0x0E,0x00,0x00000000};

                Socket s = new Socket("67.188.93.23",6346); //"201.37.69.72",12937
                PrintStream os = new PrintStream(s.getOutputStream());
                //String connect = "GET /get//walkon.mp3 HTTP/1.1\r\nUser-Agent: Gnutella\r\nHost: 127.0.0.1:14236\r\nConnection: Keep-Alive\r\nRange: bytes=0-\r\n\n";
                String connect = "GNUTELLA CONNECT/0.6\n\n";
                os.print(connect);
                BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
                os.print("GNUTELLA CONNECT/0.6 200 OK\n\n");

                for(int i = 0; i<ping.length;i++) {
                        os.print(ping[i]);
                }

                System.out.println(in.readLine());



        }
}

Can i Ping a Gnutella host without handshaking before??

thx beat,austria

birdy August 31st, 2006 03:25 PM

You'd probably be better off going to the forum below (you'll have to register again over there)... they have a programming section:)
http://www.limewire.org/forum/

beat August 31st, 2006 03:58 PM

thx, ive posted there too.

arne_bab September 13th, 2006 11:20 AM

You might want to have alook here:
http://gnuticles.gnufu.net/dev-infos.html

Initial Handshake
First from a_guest_in_the_machine from gnutellaforums.com: The initial handshake goes like this (contradicting current specs):

you
GNUTELLA CONNECT/0.6\r\n
\r\n

ultrapeer
GNUTELLA/0.6 200 (...)\r\n
(optional server specifics)\r\n
\r\n

you
GNUTELLA/0.6 200\r\n
\r\n


All times are GMT -7. The time now is 10:45 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.