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 |
please someone!!! im almost on deadline for this project... |
What client are you connecting to and what protocol version are you using? |
Re: Sockets close Quote:
|
thanks, maybe Im a bit confused about how are asynchronous sockets implemented. I've read everything I've found about gnutella, and I really cant figure out how this is actually done. So I decided to do it my way...dunno if what Im doing has a name. Sorry about reinventing the wheel, I really have to. So is what Im doing fully wrong, Im headin the wrong way? |
tshdos: Im using 0.4 handshaking, and Im connecting to a localhost with mutella, which parses me a bunch of pongs (from internet) to which I connect (so I dont know what clients Im connecting to).. |
Im really afraid bout having to start my gnutella over again and make things right this time.. so, please could somebody give me a clear explanation of how asynchronous sockets work? pleezzzzzz |
You really should use 0.6 handshaking. Its not much more difficult and everyone else is using it. See http://cvs.sourceforge.net/cgi-bin/v...ella/Draft.txt Click the first "(view)" I don't have a good answear to your question. I suppose you do aswear any pings you receive? /Tor |
Here you can find s.th. about network programming. Maybe this will help you. http://www.ecst.csuchico.edu/~beej/guide/net/html/ |
thanx guys! yes, Im answering pings and Im currently workin to see whether my pongs are OK |
All times are GMT -7. The time now is 12:32 PM. |
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.