I made more tests with my code and after reading Ramihyn's message i found this bug(?) I declared a record for the header of each message something like: Header = Record ID: TGUID; Function: Byte; TTL:byte; Hops:byte; Datalength: Integer(???) end; in the last line i declared the data length as an Integer (it is 4 bytes) which is acceptable for the Gnutella Protocol but when i send a ping message with datalength value as zero the server got a response of 33 00 00 00h instead of 00 00 00 00h. So i declared Datalength as a DWORD (which is also 4 bytes) and the problem fixed. Maybe there are more bugs like this one... Thak you for your help... :D |
Quote:
Well, for that, I will give you the records used in my Cultiv8r client :p Hopefully you can use them. Keep in mind that the records are packed! I'm using pointers to them, because I can easily reference them from memory that way - I read the entire message before processing. Code: Type Code: function CreateGUID : TGUID; |
Hi Mike! Nice to see you here! :) Morgwen |
Thank you a lot cultiv8r... but i have them... :D except the snippet for the GUID markink... my problem is that i cant make my client to connect to another servant. i send the GNUTELLA CONNECT/0.4, i take the right reply and then nothing... even if i send a ping message the servant disconnects me.:confused: |
You've got to make sure that the client accepts incoming connections and connections from a local host (local loop for example). I recommend getting Gnucleus, since this client is following the Gnutella specs quite closely. The more widely spread ones, like BearShare, have a tendency to do things their own way. It is also very important that you send nothing more for each packet than specified in the descriptor's payload length, hence my use of packed records, etc. The TTL should be > 0 and the Hops should be set at 0. If that fails, try outputting (like in a Tmemo object) what you and the other side have sent. -- Mike |
I have finally managed to connect to another servant. I used the Gnotella client and made a connections succesful. I also tried to connect using Bearshare but it always disconnects my client. Thank you people for your help.:D |
any Delphi Programmers outhere? I am trying to "understand" the data receiving from a connection. I am using a TMemoryStream as a buffer and i manage to "understand" the first Pong Reply. After that i am getting raw data. Any help? Maybe a pseydo code will help.:D |
Always read the header first. Then read the amount of bytes specified in the Payload Descriptor, whether or not it is too big for that particular message. You then handle the data you DO know (like with a pong, you know where the IP and port is located). For the data that you DON'T know, you dump on screen or in a log file so you can inspect the data (or, say, load it into a hex editor). -- Mike |
All times are GMT -7. The time now is 08:04 AM. |
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.