November 10th, 2003
|
Apprentice | | Join Date: August 6th, 2003
Posts: 8
| |
some questions about initialization of Connection! I am writing a Gnutella program, according to webcache protocol,i can connect to Gnutella NetWork,but the problem is it need to wait for a long time.
I realized as this:keep a webcache url list,and a peer list,when startup,choose one url from the webcache url list randomly and request,if return error,delete the url from the list and choose another one,do this until receive the correct response or have requested 10 times.If receive correct response,add the ultrapeers
hosts to the list the program maintaining.
At the same time,load the peer list to the list the program maintaining ,and connect two peers in one second.
When the program is colosed,write the list in the memory to the peer list file in the hard disk.
The problem need very long time to find one or more ultrapeers to connect to.But the other Gnutella software needs about only several seconds.
How to fix this problem?
Thanks! |