![]() |
|
Register | FAQ | The Twelve Commandments | Members List | Calendar | Arcade | Find the Best VPN | Today's Posts | Search |
Mutella (Linux/Unix) Mutella has been discontinued. We highly recommend you use an actively developed client instead. |
| LinkBack ![]() | Thread Tools ![]() | Display Modes ![]() |
|
| |||
![]() Hi Max, mainly about DNS and asynchronous socket class.... some ideas for a CAsyncSocket redesign: - Okay we work usually IP based (just to get a starting point) - Run a second thread which will resolve all pending DNS resolutions and store them in an array, big enough to cache all needed hostnames of an application. Size of this internal lookup table can be adjusted by user. - Two new methods BOOL Resolve(unsigned long *ipaddr) and BOOL Resolve(char* hostname). Which will query the array (multithreading safe) and eighter return the result... or FALSE and error result ADDRESS_NOT_AVAILABLE (can't be resolved) or ADDRESS_RESOLVING. In any case, the methods return immadiately and do not block! - User can query again and again for an address, until the address is resolved (in case of a FALSE return he has to continue to work with IP). - New virtual override OnResolve() which will notify the socket when a name server lookup was finished. This event might be a sucessfull finished lookup or telling that address can't be resolved. OnResolve() will called once after a succesfull/unsucessfull lookup... or more technically whenever a Resolve() call will change the internal lookup table. Other stuff: - new virtual override OnReceiveLine(), which will only called when a full line was received. Simply override OnReceive with a call to ReceiveLine(), it will do line buffering in a per socket based buffer. - add a status to each socket which can be queried with int GetStatus(), here what I use currently: enum { SOCKET_DEAD = 0, //socket is dead (delete socket) SOCKET_DISCONNECTING, //socket is performing disconnect SOCKET_UNCONNECTED, //socket is not connected SOCKET_CONNECTING, //socket is connecting SOCKET_CONNECTED, //socket is connected SOCKET_LISTENING, //socket is listening (not available for incoming "client" sockets) } ; Some things simplyfied (e.g. method parameters and return values). I have a small testing code which is only a few lines... don't ask me for full code before end of summer. ![]() Greets, Moak PS: Raphael, of course you would do better. |
| |
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
any updates to mutella? | Gateway | Mutella (Linux/Unix) | 3 | December 2nd, 2005 05:13 PM |
Mutella 0.4 is out! | maksik | Mutella (Linux/Unix) | 5 | November 20th, 2003 10:34 AM |
mutella newbie question | hotcarl | Mutella (Linux/Unix) | 2 | September 8th, 2002 05:02 AM |
Welcome to the Mutella forum | maksik | Mutella (Linux/Unix) | 3 | March 7th, 2002 07:36 AM |
Why not a Mutella forum | fefu | Mutella (Linux/Unix) | 7 | March 7th, 2002 07:19 AM |