|
Register | FAQ | The Twelve Commandments | Members List | Calendar | Arcade | Find the Best VPN | Today's Posts | Search |
Gnucleus (Windows) For assistance for users with the Gnucleus program. Important links: Updated Gnucleus 2.2.0.0 Installer! and also Updated Connection Caches for Gnucleus! |
| LinkBack | Thread Tools | Display Modes |
| |||
Open the Gnucleus.cpp file, if you look in the initialize funtion you'll see that there are two lines. m_pDoc = new CGnucleusDoc(this); CFrameMain* pMainFrame = new CFrameMain(m_pDoc); Both CGnucleusDoc and CFrameMain are created and referenced from CGnucleus which is the root node because it is the first class to be run on start up. The structure represents the fold down on gnucleus, CGnucleus is created, CGnucleus creates CGnucleusDoc and CFrameMain, CGnucleusDoc creates CGnuControl and all the other important data type classes like preferences, chat, sharing, and the cache. When CFrameMain is initialized it creates things like the window, the toolbar, the menu and it also is in charge of creating new windows, we call this the view. Its called document/view architechture, the data of a program and all the processing to the data is in the document, which is seperate from the view which simply displays the data. Step throuh the constructors of the program and you can see this, the program is nicely laid out, and the structure picture is a great help in getting from point a in the code to point b. Thanks for the questions, I like going through the code and verifying things. Thanks too for the typo fix, once I install visio again I'll make sure I change that and update the page. I just put up a screenshots section last night, check it out. |
| |||
The Timer in CFrameMain is a global timer, it handles all the sockets, chat, cleaning of old memory, everything. It is centrallized like this so that accurate statistics can be made on the status of gnucleus. |
| ||||
Perhaps you want to show those dependencies also in the 'structure'? I prefer no crossover dependencies, however, it's your code... see it as a suggestion. I just found this when looking into your code about network timers. Then I reported what was irritating in my eyes. Have a nice weekend, Moak |
| |||
The stucture represents what creates what, because if you want to access say a download that is going from the transfer window, you would look at the stucture and say, 'ok first i have to get a pointer to the frame, that will give me a pointer to the root, from the root i can get to the document, from the document i can get to the socket controller (cgnucontrol) and from there the download socket list. There are many many interactions between classes, and thats because its a normal application and class interaction is normal. Have a nice weekend also, sooo much code to write... |
| ||||
SetTimer() vs timeSetEvent() PS: I did finally decide to avoid SetTimer in my project, since I don't have a viewport/window handle in my later network class (designed to work in a DLL) and also WM_TIMER message has some bottlenecks. If you're interested read http://www.codeproject.com/system/simpletime.asp - especially the last part in the "WM_TIMER" paragraph. I think I will use an own worker thread inside the server network class (or a multimedia timer with timeSetEvent()), this can also handle notifies for finished DNS resolution or friendly TCP disconnects. Happy coding... Moak PS: CGnuNod::m_nSecsAlive might be better a DWORD instead of an int, it's the same on standart MS Windows architectures, but you never know your target. Last edited by Moak; March 3rd, 2002 at 09:56 PM. |
| ||||
CriticalSection/Mutex Hi again Swabby, what I wonder... you use a mutex (e.g. CCriticalSection CGnuControl::m_NodeAccess) only on write access to your socket lists (adding/removing nodes), but not also on read access (broadcasting packets). I don't think that std::vector<> is thread safe. I did cross check with Mutella, and Max does use a Mutex on read and write access - which is what i do usually too. I would expect unexpectable behaviours in Gnucleus - or did I overprotect my code? Greets, Moak |
| |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Question on Gnucleus sockets, STL | Kaom | Gnucleus (Windows) | 2 | August 20th, 2002 01:08 PM |
Question about Socket error | Unregistered | Support: General | 2 | June 25th, 2002 04:21 PM |
gnucleus.exe will now close | Unregistered | Gnucleus (Windows) | 0 | May 29th, 2002 01:26 AM |
Should LimeWire close when I close the terminal window? | Unregistered | General Linux Support | 4 | September 19th, 2001 08:37 PM |
socket error? | Unregistered | Gnotella (Windows) | 1 | July 15th, 2001 09:31 PM |