ED2KPacket::OfferFiles Class Reference

OfferFiles packet is used in eDonkey2000 network to publish shared files to currently connected server. More...

#include <packets.h>

Inheritance diagram for ED2KPacket::OfferFiles:

ED2KPacket::Packet List of all members.

Public Member Functions

 OfferFiles (uint8_t proto=PR_ED2K)
 OfferFiles (boost::shared_ptr< ED2KFile > f, uint8_t proto=PR_ED2K)
void push (boost::shared_ptr< ED2KFile > toAdd)
 operator std::string ()

Private Types

typedef std::vector< boost::shared_ptr<
ED2KFile > >::iterator 
Iter

Private Attributes

std::vector< boost::shared_ptr<
ED2KFile > > 
m_toOffer

Detailed Description

OfferFiles packet is used in eDonkey2000 network to publish shared files to currently connected server.

The packet contains a list of files we want to make available for others to download from us.

eDonkey2000 network sets some limitations on the files that can be made available. Namely, the file size must be <= numeric_limits<uint32_t>::max(), because sizes are used as 32-bit integers in ed2k network. This limits file size to roughly 4gb. Additionally, it is generally not recommended to publish more than 300 files. Prefered files should be large (iso, avi, etc) files, instead of small mp3 collections. Small files should be packet together into archives for publishing. However, this is user-related issue and is not related to the implementation of this class, but it is good to mention it too.

The semantics regarding this packet as as follows:

*) A full list of all shared files should be sent when server connection has been established. *) A partial list containing only added files should be sent whenever a new shared file has been added. *) An empty list should be sent on regular intervals as keep-alive packet to lugdunum servers.

Usage: Client -> Server

Definition at line 282 of file packets.h.


Member Typedef Documentation

typedef std::vector< boost::shared_ptr<ED2KFile> >::iterator ED2KPacket::OfferFiles::Iter [private]
 

Definition at line 292 of file packets.h.


Constructor & Destructor Documentation

ED2KPacket::OfferFiles::OfferFiles uint8_t  proto = PR_ED2K  ) 
 

Definition at line 282 of file packets.cpp.

ED2KPacket::OfferFiles::OfferFiles boost::shared_ptr< ED2KFile f,
uint8_t  proto = PR_ED2K
 

Definition at line 283 of file packets.cpp.

References push().


Member Function Documentation

void ED2KPacket::OfferFiles::push boost::shared_ptr< ED2KFile toAdd  )  [inline]
 

Definition at line 286 of file packets.h.

References m_toOffer.

Referenced by OfferFiles(), and ServerList::publishFiles().

ED2KPacket::OfferFiles::operator std::string  ) 
 

Definition at line 289 of file packets.cpp.

References m_toOffer, ED2KPacket::Packet::makePacket(), and OP_OFFERFILES.


Member Data Documentation

std::vector< boost::shared_ptr<ED2KFile> > ED2KPacket::OfferFiles::m_toOffer [private]
 

Definition at line 291 of file packets.h.

Referenced by operator std::string(), and push().


The documentation for this class was generated from the following files: