Gnutella Forums  

Go Back   Gnutella Forums > Current Gnutella Client Forums > GnucDNA Based Clients > Gnucleus (Windows)
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Today's Posts

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!


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old August 19th, 2002
Kaom
Guest
 
Posts: n/a
Question Question on Gnucleus sockets, STL

Why does Gnucleus use in class CGnuControl
std::vector<CGnuNode*> m_NodeList; instead of
std::list<CGnuNode*> m_NodeList; ?

Wouldn't a std::list behave more efficient when deleting random socket objects? AFAIK the server has insertion always to end, the deletion is at random positions, access is serially. A std::list fits better? *asking*

2nd question, in class CChatRoom should't
std::vector<CString> m_UserList; be a
std::map<CString, int> m_UserList; (or similar)?

An implementation of CChatRoom::FindUser() could then be more simple?

Thanks for feedback.
Reply With Quote
  #2 (permalink)  
Old August 19th, 2002
Unregistered
Guest
 
Posts: n/a
Default Kaom

In CGnuControl::~CGnuControl() you don't need to:
delete m_NodeList.back();
m_NodeList.pop_back();


First line is fine, but the pop_back() is not necesarry IMHO. Just destroy your objects, then at the end of the dtor the vector's memory is released and destroyed (any access on non existing socket objects can't happen).

Am I telling ****?
Reply With Quote
  #3 (permalink)  
Old August 20th, 2002
Kaom
Guest
 
Posts: n/a
Default

and If you don't dare to use std:map with MSVC use:
#pragma warning(disable: 4786) // aka identifier was truncated to 'number' characters in debug information
Reply With Quote
Reply


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
Sockets GaryM Support: General 1 August 27th, 2002 01:04 PM
Sockets close loStHead General Gnutella Development Discussion 9 June 4th, 2002 04:30 PM
Sockets, C and gnutella patricio General Gnutella Development Discussion 5 May 31st, 2002 05:20 AM
Question on Gnucleus socket Close() Moak Gnucleus (Windows) 17 March 5th, 2002 04:08 PM
Sockets accumulating Unregistered Connection Problems 0 September 14th, 2001 08:14 PM


All times are GMT -7. The time now is 08:43 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.