Detail Namespace Reference


Classes

class  ClientExtBase
 Base class for "Client Extensions" - state-dependant parts of Client constructed as needed; Encapsulates m_parent pointer, which the extension can use to access the parent object. More...
class  UploadInfo
 UploadInfo object is a part of Client object that represents the upload state. More...
class  QueueInfo
 QueueInfo object is part of Client object that represents the queue state. More...
class  DownloadInfo
 DownloadInfo object controls downloading data from the remote client. More...
class  SourceInfo
 SourceInfo indicates a client which has one (or more) files to offer to us. More...
struct  ClientListIndices
 ClientList indexes. More...
struct  CList
 ClientList type. More...
struct  CreditsDbIndices
struct  CreditsList
struct  MIDownloadList
struct  MIDownloadListIterator
class  Server
 Server represents one server object. More...
struct  ServerNameExtractor
 ServerName extractor functor. More...
struct  ServerAddrExtractor
 ServerAddr extractor functor. More...
struct  QueryTimeExtractor
 last udp query time extractor functor More...
struct  ServerListIndices
 Server list structure, sorted by IP address and name. More...
struct  MIServerList
struct  QTIter

Object counters

size_t s_queueInfoCnt = 0
size_t s_uploadInfoCnt = 0
size_t s_downloadInfoCnt = 0
size_t s_sourceInfoCnt = 0

Signals emitted from Client object

These are declared here, as global, because we cannot use static data in modules.

boost::signal< void(Client *,
uint32_t) 
changeId )
 Emitted when a client changes it's ID.
boost::signal< bool(const
Hash< ED2KHash > &, IPV4Address,
IPV4Address, bool) > 
foundSource
 Emitted when a new source is discovered by a client.
boost::signal< void(IPV4Address)> foundServer
 Emitted when a new server is discovered.

Typedefs

typedef boost::shared_ptr<
std::vector< bool > > 
PartMapPtr
 PartMaps are shared between SourceInfo and DownloadInfo.
typedef CList::nth_index<
ID_Client >::type 
CMap
typedef CList::nth_index<
ID_Id >::type 
IDMap
typedef CList::nth_index<
ID_Hash >::type 
HashMap
typedef CMap::iterator CIter
typedef IDMap::iterator IIter
typedef HashMap::iterator HashIter
typedef CreditsList::nth_index<
ID_Id >::type::iterator 
IDIter
typedef CreditsList::nth_index<
ID_PubKey >::type::iterator 
KeyIter
typedef MIDownloadList::nth_index<
ID_PD >::type::iterator 
Iter
typedef MIDownloadList::nth_index<
ID_Download >::type::iterator 
DIter
typedef MIDownloadList::nth_index<
ID_SrcCnt >::type::iterator 
SrcCIter
typedef MIDownloadList::nth_index<
ID_UdpQTime >::type::iterator 
QTIter
typedef boost::shared_ptr<
QueueInfo
QueueInfoPtr
 Client class extension types.
typedef boost::shared_ptr<
UploadInfo
UploadInfoPtr
typedef boost::shared_ptr<
SourceInfo
SourceInfoPtr
typedef boost::shared_ptr<
DownloadInfo
DownloadInfoPtr
typedef MIServerList::nth_index<
0 >::type::iterator 
ServIter
typedef MIServerList::nth_index<
1 >::type::iterator 
AddrIter
typedef MIServerList::nth_index<
2 >::type::iterator 
NameIter

Enumerations

enum  { ID_Client, ID_Id, ID_Hash }
 Different index ID's. More...
enum  CreditsListKeys { ID_Id, ID_Hash, ID_PubKey, ID_LastSeen }
enum  {
  ID_PD, ID_Download, ID_Hash, ID_SrcCnt,
  ID_UdpQTime
}

Functions

 IMPLEMENT_EVENT_TABLE (Server, Server *, int)
std::ostream & operator<< (std::ostream &o, const Server &s)

Variables

const std::string TRACE_CLIENT = "Ed2kClient"
const uint32_t SEND_TO_ONE_CLIENT = ED2K_PARTSIZE
 How much data to send to a single client during an upload session.

Typedef Documentation

typedef boost::shared_ptr<std::vector<bool> > Detail::PartMapPtr
 

PartMaps are shared between SourceInfo and DownloadInfo.

Definition at line 33 of file clientext.h.

typedef CList::nth_index<ID_Client>::type Detail::CMap
 

Definition at line 97 of file clientlist.cpp.

typedef CList::nth_index<ID_Id>::type Detail::IDMap
 

Definition at line 98 of file clientlist.cpp.

typedef CList::nth_index<ID_Hash>::type Detail::HashMap
 

Definition at line 99 of file clientlist.cpp.

typedef CMap::iterator Detail::CIter
 

Definition at line 100 of file clientlist.cpp.

typedef IDMap::iterator Detail::IIter
 

Definition at line 101 of file clientlist.cpp.

typedef MIDownloadList::nth_index< ID_Hash >::type::iterator Detail::HashIter
 

Definition at line 102 of file clientlist.cpp.

typedef CreditsList::nth_index<ID_Id >::type::iterator Detail::IDIter
 

Definition at line 121 of file creditsdb.cpp.

typedef CreditsList::nth_index<ID_PubKey>::type::iterator Detail::KeyIter
 

Definition at line 123 of file creditsdb.cpp.

typedef MIDownloadList::nth_index<ID_PD>::type::iterator Detail::Iter
 

Definition at line 147 of file downloadlist.cpp.

typedef MIDownloadList::nth_index<ID_Download>::type::iterator Detail::DIter
 

Definition at line 148 of file downloadlist.cpp.

typedef MIDownloadList::nth_index<ID_SrcCnt>::type::iterator Detail::SrcCIter
 

Definition at line 150 of file downloadlist.cpp.

typedef MIDownloadList::nth_index<ID_UdpQTime>::type::iterator Detail::QTIter
 

Definition at line 151 of file downloadlist.cpp.

typedef boost::shared_ptr<QueueInfo > Detail::QueueInfoPtr
 

Client class extension types.

Definition at line 95 of file ed2kfwd.h.

typedef boost::shared_ptr<UploadInfo > Detail::UploadInfoPtr
 

Definition at line 96 of file ed2kfwd.h.

typedef boost::shared_ptr<SourceInfo > Detail::SourceInfoPtr
 

Definition at line 97 of file ed2kfwd.h.

typedef boost::shared_ptr<DownloadInfo> Detail::DownloadInfoPtr
 

Definition at line 98 of file ed2kfwd.h.

typedef MIServerList::nth_index<0>::type::iterator Detail::ServIter
 

Definition at line 89 of file serverlist.cpp.

typedef MIServerList::nth_index<1>::type::iterator Detail::AddrIter
 

Definition at line 90 of file serverlist.cpp.

typedef MIServerList::nth_index<2>::type::iterator Detail::NameIter
 

Definition at line 91 of file serverlist.cpp.


Enumeration Type Documentation

anonymous enum
 

Different index ID's.

Enumeration values:
ID_Client 
ID_Id 
ID_Hash 

Definition at line 96 of file clientlist.cpp.

enum CreditsListKeys
 

Enumeration values:
ID_Id 
ID_Hash 
ID_PubKey 
ID_LastSeen 

Definition at line 120 of file creditsdb.cpp.

anonymous enum
 

Enumeration values:
ID_PD 
ID_Download 
ID_Hash 
ID_SrcCnt 
ID_UdpQTime 

Definition at line 146 of file downloadlist.cpp.


Function Documentation

IMPLEMENT_EVENT_TABLE Server  ,
Server *  ,
int 
 

std::ostream& operator<< std::ostream &  o,
const Server &  s
 

Definition at line 140 of file server.cpp.

References ST_AUXPORTLIST, ST_DESC, ST_DYNIP, ST_FAIL, ST_HARDLIMIT, ST_LASTPING, ST_MAXUSERS, ST_NAME, ST_PING, ST_PREFERENCE, ST_SOFTLIMIT, ST_UDPFLAGS, and ST_VERSION.


Variable Documentation

const std::string Detail::TRACE_CLIENT = "Ed2kClient"
 

Definition at line 31 of file clientext.cpp.

Referenced by Detail::UploadInfo::addReqChunk(), Detail::UploadInfo::bufferData(), Detail::UploadInfo::compress(), ClientList::exit(), ClientList::onClientEvent(), Detail::SourceInfo::remOffered(), Detail::DownloadInfo::write(), Detail::DownloadInfo::writePacked(), Detail::DownloadInfo::~DownloadInfo(), and Detail::UploadInfo::~UploadInfo().

const uint32_t Detail::SEND_TO_ONE_CLIENT = ED2K_PARTSIZE
 

How much data to send to a single client during an upload session.

Current ED2K clients seem to use ED2K_PARTSIZE here, which means 9.28mb, so that's what we should use.

If you want faster Queue rotation, lowering this value would give the desired result. It is recommended to keep this value at least in n*ED2K_CHUNKSIZE, to promote full chunks sending.

Definition at line 42 of file clientext.cpp.

Referenced by Detail::UploadInfo::addReqChunk().

size_t Detail::s_queueInfoCnt = 0
 

Definition at line 46 of file clientext.cpp.

Referenced by Detail::QueueInfo::count(), Detail::QueueInfo::QueueInfo(), and Detail::QueueInfo::~QueueInfo().

size_t Detail::s_uploadInfoCnt = 0
 

Definition at line 47 of file clientext.cpp.

Referenced by Detail::UploadInfo::count(), Detail::UploadInfo::UploadInfo(), and Detail::UploadInfo::~UploadInfo().

size_t Detail::s_downloadInfoCnt = 0
 

Definition at line 48 of file clientext.cpp.

Referenced by Detail::DownloadInfo::count(), Detail::DownloadInfo::DownloadInfo(), and Detail::DownloadInfo::~DownloadInfo().

size_t Detail::s_sourceInfoCnt = 0
 

Definition at line 49 of file clientext.cpp.

Referenced by Detail::SourceInfo::count(), Detail::SourceInfo::SourceInfo(), and Detail::SourceInfo::~SourceInfo().

boost::signal<void (Client*, uint32_t) Detail::changeId)
 

Emitted when a client changes it's ID.

Parameters:
Client* Client that changed it's ID
uint32_t The new ID of the client

Definition at line 101 of file clients.cpp.

Referenced by Client::onPacket(), and Client::storeInfo().

boost::signal< bool(const Hash< ED2KHash > &, IPV4Address, IPV4Address, bool) > Detail::foundSource
 

Emitted when a new source is discovered by a client.

Parameters:
Hash<ED2KHash>& Hash of the file the source offers
IPV4Address Source IP/port
IPV4Address Server IP/port where the source is
bool If true, attempt to connect to the client now
Returns:
True if the source was added, false otherwise

Definition at line 104 of file clients.cpp.

Referenced by ServerList::handleGlobSources(), ServerList::onPacket(), and Client::onPacket().

boost::signal< void(IPV4Address)> Detail::foundServer
 

Emitted when a new server is discovered.

Parameters:
IPV4Address The server's IP/port

Definition at line 105 of file clients.cpp.

Referenced by Client::onPacket().