Gnutella Forums  

Go Back   Gnutella Forums > Gnutella News and Gnutelliums Forums > General Gnutella Development Discussion
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Today's Posts

General Gnutella Development Discussion For general discussion about Gnutella development.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old December 23rd, 2001
Unregistered
Guest
 
Posts: n/a
Default Help On Gnutella Protocol

I am trying to make simple component that makes a connection to a Gnutella client. Right now i managed to get a "GNUTELLA OK" reply but when i send back a ping message the connection drops.
I read that i should send a ping after getting the OK from the client. Is this right? What am i doing wrong?
The component is written in Delphi with the TWsocket component.
Reply With Quote
  #2 (permalink)  
Old December 25th, 2001
Moak's Avatar
Guest
 
Join Date: September 7th, 2001
Location: Europe
Posts: 816
Moak is flying high
Default

Hmm... which test clients do you use? Did you tried to connect to your own client?
Reply With Quote
  #3 (permalink)  
Old December 25th, 2001
veniamin's Avatar
Devotee
 
Join Date: December 17th, 2001
Posts: 24
veniamin is flying high
Default

I built a simple test program that uses this component and i try to connect to other Gnutella clients, localy on my computer, like Gnotella and Bearshare.
I succeed to send a GNUTELLA CONNECT/0.4 and also i take the right reply (GNUTELLA OK) but when i send a Ping message, i always disconnect.
Any help?
Reply With Quote
  #4 (permalink)  
Old December 25th, 2001
Moak's Avatar
Guest
 
Join Date: September 7th, 2001
Location: Europe
Posts: 816
Moak is flying high
Default

Perhaps you did send a bad package/descriptor, maybe ping with payload or a strange TTL? Try to check protocol specifications once more or take a look in existing source code.

Hope it helps, Moak
Reply With Quote
  #5 (permalink)  
Old December 25th, 2001
Moak's Avatar
Guest
 
Join Date: September 7th, 2001
Location: Europe
Posts: 816
Moak is flying high
Default

PS: GodXBlue gave me another hint on IRC. Make sure you follow the protocoll specification for connectiing and send only 'GNUTELLA CONNECT/0.4\n\n'... and NOTHING more! Each extra byte is definitely wrong here and will corrupt your data stream, e.g. any following descriptor will be corrupted.
Reply With Quote
  #6 (permalink)  
Old December 25th, 2001
veniamin's Avatar
Devotee
 
Join Date: December 17th, 2001
Posts: 24
veniamin is flying high
Default

When i send the GNUTELLA CONNECT/0.4\n\n string it is ok because i have tested it and i take a succesful reply (GNUTELLA OK).

The structure of the Ping message that i send is exactly the same with the protocol specifications. The GUID is beeing created with the CoCreateGUID function of the Windows API and the TTL value is 5. Also the HOPs value is 0 and the data length is zero.

When i am trying to connect to Bearshare at the Hosts Screen in the status of the connection writes 'Coming' and when i connect writes 'Temp' and counts about 5 seconds and then i get a disconnect time expired message...
Reply With Quote
  #7 (permalink)  
Old December 25th, 2001
Moak's Avatar
Guest
 
Join Date: September 7th, 2001
Location: Europe
Posts: 816
Moak is flying high
Default

You automatically get a "GNUTELLA OK" after sending the two returns (\n). When you will send extra bytes after the two returns, you will shift your binary data stream and every following descriptor will be corrupted... did you understand this and checked against it? Most existing clients will drop a connection when they receive bad data. Sorry, I have no further idea.... perhaps look inside existing code or test if two of your clients will understand each other?
Reply With Quote
  #8 (permalink)  
Old December 25th, 2001
veniamin's Avatar
Devotee
 
Join Date: December 17th, 2001
Posts: 24
veniamin is flying high
Default

hmmm... i understand...

I will see my source code again and i will inform you... Thank you..
Reply With Quote
  #9 (permalink)  
Old December 26th, 2001
Moak's Avatar
Guest
 
Join Date: September 7th, 2001
Location: Europe
Posts: 816
Moak is flying high
Default

Heyho again! Did you find the problem? *curious*
Reply With Quote
  #10 (permalink)  
Old December 28th, 2001
Ramihyn
Guest
 
Posts: n/a
Default

You may have a problem with variable alignment if you created a structure for the descriptor and fill the members of it. Ofc it depends on the type of variables you used, your compiler and it's alignment.

If you created your own structure (typedef struct {} in C), you may want to add a safety check at the initialisation code which tests for the sizeof() of the struct.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spin-off of Gnutella Protocol? PhreakerONE General Gnutella Development Discussion 0 June 6th, 2002 03:57 PM
gnutella protocol Unregistered General Gnutella / Gnutella Network Discussion 2 May 19th, 2002 11:23 AM
Gnutella protocol and hostcaches bateman23 General Gnutella Development Discussion 5 January 9th, 2002 04:42 AM
gnutella protocol v0.6? chuckles42 Gnucleus (Windows) 0 September 15th, 2001 09:11 AM
Gnutella protocol to sloppy? Tiago s1x General Gnutella Development Discussion 3 August 6th, 2001 05:20 PM


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