Gnutella Forums  

Go Back   Gnutella Forums > Discontinued Gnutella Client Forums > Mutella (Linux/Unix)
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Today's Posts

Mutella (Linux/Unix) Mutella has been discontinued. We highly recommend you use an actively developed client instead.


 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6 (permalink)  
Old August 10th, 2002
Moak
Guest
 
Posts: n/a
Post Development: socket redesign

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.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
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


All times are GMT -7. The time now is 09:52 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.