libktorrent  2.1.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
bt::ServerInterface Class Referenceabstract

#include <serverinterface.h>

Inheritance diagram for bt::ServerInterface:
Inheritance graph
[legend]

Public Member Functions

 ServerInterface (QObject *parent=0)
 
virtual bool changePort (Uint16 port)=0
 

Static Public Member Functions

static void addPeerManager (PeerManager *pman)
 
static QStringList bindAddresses ()
 
static void disableEncryption ()
 
static void enableEncryption (bool allow_unencrypted)
 
static bool findInfoHash (const SHA1Hash &skey, SHA1Hash &info_hash)
 
static PeerManagerfindPeerManager (const SHA1Hash &hash)
 
static Uint16 getPort ()
 Get the port in use.
 
static bool isEncryptionEnabled ()
 
static bool isUtpEnabled ()
 
static bool onlyUseUtp ()
 
static TransportProtocol primaryTransportProtocol ()
 
static void removePeerManager (PeerManager *pman)
 
static void setPort (Uint16 p)
 Set the port to use.
 
static void setPrimaryTransportProtocol (TransportProtocol proto)
 
static void setUtpEnabled (bool on, bool only_use_utp)
 
static bool unencryptedConnectionsAllowed ()
 

Protected Member Functions

void newConnection (mse::EncryptedPacketSocket::Ptr sock)
 

Static Protected Attributes

static bool allow_unencrypted
 
static bool encryption
 
static bool only_use_utp
 
static QList< PeerManager * > peer_managers
 
static Uint16 port
 
static TransportProtocol primary_transport_protocol
 
static bool utp_enabled
 

Detailed Description

Base class for all servers which accept connections.

Definition at line 57 of file serverinterface.h.

Member Function Documentation

◆ addPeerManager()

static void bt::ServerInterface::addPeerManager ( PeerManager pman)
static

Add a PeerManager.

Parameters
pmanThe PeerManager

◆ bindAddresses()

static QStringList bt::ServerInterface::bindAddresses ( )
static

Get a list of potential IP addresses to bind to

◆ changePort()

virtual bool bt::ServerInterface::changePort ( Uint16  port)
pure virtual

Change the port.

Parameters
portThe new port

Implemented in bt::Server, and utp::UTPServer.

◆ disableEncryption()

static void bt::ServerInterface::disableEncryption ( )
static

Disable encrypted authentication.

◆ enableEncryption()

static void bt::ServerInterface::enableEncryption ( bool  allow_unencrypted)
static

Enable encryption.

Parameters
allow_unencryptedAllow unencrypted connections (if encryption fails)

◆ findInfoHash()

static bool bt::ServerInterface::findInfoHash ( const SHA1Hash skey,
SHA1Hash info_hash 
)
static

Find the info_hash based on the skey hash. The skey hash is a hash of 'req2' followed by the info_hash. This function finds the info_hash which matches the skey hash.

Parameters
skeyHASH('req2',info_hash)
info_hashwhich matches
Returns
true If one was found

◆ findPeerManager()

static PeerManager* bt::ServerInterface::findPeerManager ( const SHA1Hash hash)
static

Find the PeerManager given the info_hash of it's torrent.

Parameters
hashThe info_hash
Returns
The PeerManager or 0 if one can't be found

◆ removePeerManager()

static void bt::ServerInterface::removePeerManager ( PeerManager pman)
static

Remove a PeerManager.

Parameters
pmanThe PeerManager

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