![]() |
Hostcache... how do I access them? How do I get IP addresses from a host cache, which protocoll? Thank you! |
Normaly a gnutella client automaticly connect to a host cacher! Or what do you mean, I think I canīt follow you! |
Pallando, this is a _developer_ forum... the question is well formulated. So does anyone know about the theory of hostcaches, how they work, collect IPs and how to connect them in a gnutella client? |
Ups! :D |
hostcaches Okay, I wanna give a short overview on how to use a hostcache. A Gnutella Hostcache has a single purpose, it will feed you with a bunch of fresh IP-addresses from other Gnutella servants. We allready know that a gnutella servant (YOU) is connected to a few other servants (or to superpeers if available in future). While Gnutella works decentral your client needs a starting point: 1) Hostcaches provide fresh IPs and are a good starting point if you need to find more servants. Connect to an hostcache using the normal Gnutella protocoll [1], the host cache serve the single purpose of responding with pongs to your ping, and disconnecting afterwards. 2) Many servants collect IPs of other servants while they are connected (from those they are connected or from received PONGs) and reuse them on startup. Note to 1: Don't forget a hostcache will allway drop the connection after serving you the IPs (around 100 pongs usually, but I heared from a hostcache responding with 1000 pongs). There could be also a number of other reasons you are disconnected. Propably the servent is just busy now and can't handle more connections... or pinging you, but you aren't answering with a pong... or you don't share files (see your ping descriptor data) and disconnect because it doesn't help freeloaders. The best idea is to ask many hostcaches [2]. Btw, do not hardcode the gnutella hostcaches as IPs into your code (use hostnames here). Because IPs can change and a DNS resolution does not take a lot of time.... maybe you wanna add the current IP of your hostcaches into your hostslist (see next note). Note to 2: Collecting IPs of other servants, especially of servants you have been allready connected with, gives you the advantage of a much faster gnutella startup (a few seconds)! Without such a list, you have to query every hostcache and try every IP until you are connected to some servants (or superpeer). Servants may be down or currently accepting no new connections... this try'n'connect could take up to two minutes. Think about collecting and storing IPs into a file (e.g. Xolox stores a few hundred IPs into a hostslist file). Additional Links: [1] Gnutella Protocoll http://www.clip2.com/GnutellaProtocol04.pdf [2] Host caches http://www.gnutellaforums.com/showth...4638#post16845 Actually I'm not a client developer, these information are only as far as I found out from analyzing Xolox, Bearshare and reading various Gnutella articles. It would be nice if some developers of current clients could give us a feedback. Hope it helps, Moak :) |
???? sorry, i'm a newbie... if i connect to a hostcache like 'connect1.gnutellanet.com:6346' the server sends a GNU-Header with the Query-Flag and 88 bytes payload... then it cuts the connection. how can i decode this data to reach the IPs & Ports?? thanx, Pferdo |
Your question about the 88 byte payload Hey, I had the same problem with connection to the connect1.gnutellahosts.com caches and getting a query message with an 88 byte payload. I think that this message is used to let BearShare users know if there is an update -- thus, in the method that reads a query, check to see if the last byte is 0 (null), as it should be, if it isn't, raise an exception and handle it in your host caching method by ignoring the message. I believe you have to ping the host to start getting pongs in reply as the caches actually "attach" to the network and I believe they will route your ping to actual hosts. If you don't do so, the host will drop you and you won't get any pongs. Hope this helps, like I said, I had the same problem and was just as confounded, Andrew |
thx Thank you for the explanation of this query msg! soon i started ignoring this msg too and send simply a ping... and it worked :) CU |
All times are GMT -7. The time now is 01:05 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.
Copyright Đ 2020 Gnutella Forums.
All Rights Reserved.