View Single Post
  #6 (permalink)  
Old April 22nd, 2002
Smilin' Joe Fission Smilin' Joe Fission is offline
Gnutella Veteran
 
Join Date: March 14th, 2002
Location: Canada
Posts: 121
Smilin' Joe Fission is flying high
Default Re: ya i tried that with gnutella 0.56

Quote:
Originally posted by abhiexx
which means that i am doing something wrong in my code...maybe someone can specify the exact sequence of transfers that take place when a client connects to my server...
The sequence of events (as I understand it) starts with your server listening on a specific port (normally 6346) for a connection attempt. After making a connection to your server, the remote client would initiate the handshake procedure. Under the Gnutella 0.4 protocol (I don't have the 0.6 handshaking stuff handy), the client would start with "GNUTELLA CONNECT 0.4\n\n" and your server would respond with "GNUTELLA OK\n\n". Then your server should wait for the remote client to send a ping. Upon receiving the ping, your server would respond with a pong (and it would also propogate that ping to all of the other nodes you're connected to, but first things first). Any pongs you receive from other nodes responding to the ping that was sent by the remote client would also be routed back to it. The rest we can get to when you've made a successful connection.

Quote:
well another interesting thing that cropped up was that..i sent a ping after the gnutella ok part...bearshare reported that as a bad packet....however...if i sent a pong it didn't show up at all !

however both these packets are reported as good packets...if a write ...to the bearshare server....using...a client thread in my code......hell this is confusing stuff....GIMME A FREAKING BREAK !!!
Just off the top of my head, are you sure the packets your server is sending are of the correct size? For instance, a ping is always 23 bytes. Any shorter and it would probably be detected as a bad packet.
Reply With Quote