libktorrent  2.2.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
net::Socks Class Reference

#include <socks.h>

Inheritance diagram for net::Socks:
Inheritance graph
[legend]

Public Types

enum  SetupState { NONE, AUTH_REQUEST_SENT, USERNAME_AND_PASSWORD_SENT, CONNECT_REQUEST_SENT }
 
enum  State {
  IDLE, CONNECTING_TO_SERVER, CONNECTING_TO_HOST, CONNECTED,
  FAILED
}
 

Public Member Functions

 Socks (mse::EncryptedPacketSocket::Ptr sock, const Address &dest)
 
State onReadyToRead ()
 
State onReadyToWrite ()
 
State setup ()
 Setup a socks connection, return the current state.
 

Static Public Member Functions

static bool enabled ()
 Is socks enabled.
 
static void setSocksAuthentication (const QString &username, const QString &password)
 
static void setSocksEnabled (bool on)
 Enable or disable socks.
 
static void setSocksServerAddress (const QString &host, bt::Uint16 port)
 Set the socks server address.
 
static void setSocksVersion (int version)
 Set the socks version (4 or 5)
 

Detailed Description

Author
Joris Guisson

Class which handles the SOCKSv5 protocol

Definition at line 36 of file socks.h.

Member Function Documentation

◆ onReadyToRead()

State net::Socks::onReadyToRead ( )

There is data available on the socked

Returns
The current state

◆ onReadyToWrite()

State net::Socks::onReadyToWrite ( )

The socket is ready to write (used to determine if we are connected to the server)

Returns
The current state

◆ setSocksAuthentication()

static void net::Socks::setSocksAuthentication ( const QString &  username,
const QString &  password 
)
static

Set the SOCKSv5 Username and password

Parameters
usernameThe username
passwordThe password

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