Protocols::BitTorrent::Transfers::PacketSession Class Reference

#include <PacketSession.h> [code]

Inherits Protocols::Generics::GenericSession.

Inheritance diagram for Protocols::BitTorrent::Transfers::PacketSession:

Inheritance graph
[legend]
Collaboration diagram for Protocols::BitTorrent::Transfers::PacketSession:

Collaboration graph
[legend]
List of all members.

Detailed Description

Session for exchange of BitTorrent packets.

Todo:
Calculate the max packet size. The transport buffer should be able to fit the biggest packet (either piece or bitfield).
Todo:
When a choke is received, all pending requests not sent to the OS TCP buffer should be dropped (suggested by official specs). What should out PacketBuffer be like? Should we be able to drop packets from the PacketBuffer. In reality we cannot guarantee that we send no more requests after a choke is received, simply because we could send right before we read the choke, which means that due to network latency, the remore party will receive requests even though it has sent a choke. To support pipelining, we the Transfers will remember requests for which pieces have been sent and new request will be sent only after a piece packet matching any of the requests is received.

Definition at line 48 of file PacketSession.h.

Public Member Functions

 PacketSession (auto_ptr< Transport > transport, SessionStatus *status)
 ~PacketSession ()

Private Types

typedef FifoQueue PacketQueue

Private Member Functions

CALITKO_TESTABLE PacketSession (const PacketSession &)
PacketSessionoperator= (const PacketSession &)

Private Attributes

auto_ptr< Transporttransport
PacketProtocol packetProtocol
PacketSerializer packetSerializer
PacketQueue packetQueue
SessionStatusstatus


Member Typedef Documentation

typedef FifoQueue Protocols::BitTorrent::Transfers::PacketSession::PacketQueue [private]
 

Definition at line 58 of file PacketSession.h.


Constructor & Destructor Documentation

CALITKO_TESTABLE Protocols::BitTorrent::Transfers::PacketSession::PacketSession const PacketSession  )  [private]
 

PacketSession::PacketSession auto_ptr< Transport transport,
SessionStatus status
 

Definition at line 28 of file PacketSession.cpp.

PacketSession::~PacketSession  ) 
 

Definition at line 39 of file PacketSession.cpp.


Member Function Documentation

PacketSession& Protocols::BitTorrent::Transfers::PacketSession::operator= const PacketSession  )  [private]
 


Member Data Documentation

PacketProtocol Protocols::BitTorrent::Transfers::PacketSession::packetProtocol [private]
 

Definition at line 61 of file PacketSession.h.

PacketQueue Protocols::BitTorrent::Transfers::PacketSession::packetQueue [private]
 

Definition at line 63 of file PacketSession.h.

PacketSerializer Protocols::BitTorrent::Transfers::PacketSession::packetSerializer [private]
 

Definition at line 62 of file PacketSession.h.

SessionStatus* Protocols::BitTorrent::Transfers::PacketSession::status [private]
 

Reimplemented from Protocols::Generics::GenericSession.

Definition at line 64 of file PacketSession.h.

auto_ptr<Transport> Protocols::BitTorrent::Transfers::PacketSession::transport [private]
 

Reimplemented from Protocols::Generics::GenericSession.

Definition at line 60 of file PacketSession.h.


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