Electroneum
Public Member Functions | Private Member Functions | Private Attributes | List of all members
net::socks::connect_client< Handler > Class Template Reference

#include <socks.h>

Inheritance diagram for net::socks::connect_client< Handler >:
Inheritance graph
[legend]
Collaboration diagram for net::socks::connect_client< Handler >:
Collaboration graph
[legend]

Public Member Functions

 connect_client (stream_type::socket &&proxy, socks::version ver, Handler &&handler)
 
virtual ~connect_client () override
 
- Public Member Functions inherited from net::socks::client
 client (stream_type::socket &&proxy, socks::version ver)
 
 client (const client &)=delete
 
virtual ~client ()
 
clientoperator= (const client &)=delete
 
stream_type::socket take_socket ()
 
socks::version socks_version () const noexcept
 
epee::span< const std::uint8_t > buffer () const noexcept
 
void clear_command () noexcept
 
bool set_connect_command (const epee::net_utils::ipv4_network_address &address)
 Try to set address as remote connection request. More...
 
bool set_connect_command (boost::string_ref domain, std::uint16_t port)
 Try to set domain + port as remote connection request. More...
 
bool set_connect_command (const net::tor_address &address)
 Try to set address as remote Tor hidden service connection request. More...
 
bool set_connect_command (const net::i2p_address &address)
 Try to set address as remote i2p hidden service connection request. More...
 
bool set_resolve_command (boost::string_ref domain)
 Try to set domain as remote DNS A record lookup request. More...
 

Private Member Functions

virtual void done (boost::system::error_code error, std::shared_ptr< client >) override
 

Private Attributes

Handler handler_
 

Additional Inherited Members

- Public Types inherited from net::socks::client
using stream_type = boost::asio::ip::tcp
 
- Static Public Member Functions inherited from net::socks::client
static bool connect_and_send (std::shared_ptr< client > self, const stream_type::endpoint &proxy_address)
 
static bool send (std::shared_ptr< client > self)
 

Constructor & Destructor Documentation

◆ connect_client()

template<typename Handler >
net::socks::connect_client< Handler >::connect_client ( stream_type::socket &&  proxy,
socks::version  ver,
Handler &&  handler 
)
inlineexplicit

◆ ~connect_client()

template<typename Handler >
virtual net::socks::connect_client< Handler >::~connect_client ( )
inlineoverridevirtual

Member Function Documentation

◆ done()

template<typename Handler >
virtual void net::socks::connect_client< Handler >::done ( boost::system::error_code  error,
std::shared_ptr< client self 
)
inlineoverrideprivatevirtual

Only invoked after *send(...) function completes or fails. bool(error) == false indicates success; self.get() is always this and allows implementations to skip std::enable_shared_from_this<T> (ASIO callbacks need shared_ptr). The design saves space and reduces cycles (everything uses moves, so no atomic operations are ever necessary).

Parameters
errorwhen processing last command (if any).
selfshared_ptr<client> handle to this.

Implements net::socks::client.

Member Data Documentation

◆ handler_

template<typename Handler >
Handler net::socks::connect_client< Handler >::handler_
private

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