![]() |
|
Register | FAQ | The Twelve Commandments | Members List | Calendar | Arcade | Find the Best VPN | Today's Posts | Search |
General Gnutella Development Discussion For general discussion about Gnutella development. |
![]() |
| LinkBack | Thread Tools | Display Modes |
| ||||
![]() Hi, after reading some Gnutella servants source code [1] and talking with some other developers, it seems that model number 3 (select()-based or poll()-based) is the common tactic. I think this model does fit to the needs of a gnutella servant (fast response and handling a high amount connections) and it perfectly supports a flexibel object orientated programming concept (okay, I personally love C++ and object orientated programming) [2]. Greets, Moak [1] Gnutelladev - http://www.gnutelladev.com/source.html [2] Programming a Gnutella Client, part II: network core Last edited by Moak; January 30th, 2002 at 06:52 PM. |
| |||
![]() I'm also currently working on a servent and mine will use kqueues. Unfortunately the only system i know that support them are FreeBSD and possible other BSD variants... For systems that dont support it (like linux/windows) it is emulated using select (some minor overhead here) |
| ||||
![]() Basic Winsock - http://tangentsoft.net/wskfaq/exampl...ics/index.html What Kind of Socket Should I Use? - http://www.warmi.net/httpd/html/vari...ket-types.html How to Use TCP Effectively - http://www.warmi.net/httpd/html/vari...ctive-tcp.html |
| |||
![]() Both poll() and select() take a list with file descriptors. One could implement poll() with select(), and select() with poll() and the program wouldn't even know. However, poll() doesnt have to clear the set, doesnt have to possibly look in 3 sets for 1 socket, and doesnt have to create 3 new sets to return. With this knowledge, poll() would be faster. ![]() BSD manpage extract: COMPATIBILITY This implementation differs from the historical one in that a given file descriptor may not cause poll() to return with an error. In cases where this would have happened in the historical implementation (e.g. trying to poll a revoke(2)ed descriptor), this implementation instead copies the events bitmask to the revents bitmask. Attempting to perform I/O on this descriptor will then return an error. This behaviour is believed to be more useful. So there you have it. I dont use neither of them :P Tam |
| ||||
![]() Type 1 "multithreaded server" is handling simultaneous requests with one thread per every socket. Type 3 "select()-based server" is handling simultaneous requests, one server thread will handle all sockets at once. I would prefer poll() over select() today. /Moak |
![]() |
| |
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Oldfashioned concept? | Unregistered | Gtk-Gnutella (Linux/Unix/Mac OSX/Windows) | 21 | July 16th, 2006 08:09 PM |
Using gnutella to mirror webpages, a test of the concept | arne_bab | General Gnutella / Gnutella Network Discussion | 0 | July 30th, 2004 03:04 AM |
Anti-RIAA Attack Concept | schnarff | General P2P Network Discussion | 4 | August 6th, 2003 03:46 AM |
Don't invite RIAA into your home -- a modified P2P concept | jlogajan | General Gnutella / Gnutella Network Discussion | 16 | August 6th, 2003 12:43 AM |
Send your ideas for a new Phex Security Concept | GregorK | General Discussion | 0 | November 21st, 2002 01:52 AM |