Thread: Sockets close
View Single Post
  #1 (permalink)  
Old May 28th, 2002
loStHead loStHead is offline
Apprentice
 
Join Date: May 27th, 2002
Posts: 8
loStHead is flying high
Default Sockets close

Hi, Im kind of new to this and I have a problem...
Im using asynchronous non-blocking sockets on my Gnutella, and just after I make a successfull connection, I send a ping, receive pongs, and then the socket disconnects. Im using plain send() and recv() calls and a main poll cycle which constantly checks for incoming packets. Im not sure if the problem is that Im getting out of sync or that I should send pings more often to keep the connection alive. Im also getting lots of query, pongs, pings, etc which I (guess) successfully broadcast. Just after that, the socket resets the connection.

eg. a poll tells me I have incoming data to handle, and then my receive function receives 0 bytes. Why's that?

Thanks
Reply With Quote