Electroneum
net::socks::client::async_close Struct Reference

#include <socks.h>

Public Member Functions

void operator() (boost::system::error_code error=boost::system::error_code{})
 

Public Attributes

std::shared_ptr< clientself_
 

Detailed Description

Callback for closing socket. Thread-safe with *send functions; never blocks (uses strands).

Definition at line 199 of file socks.h.

Member Function Documentation

◆ operator()()

void net::socks::client::async_close::operator() ( boost::system::error_code  error = boost::system::error_code{})

Definition at line 316 of file socks.cpp.

317  {
318  if (self_ && error != boost::system::errc::operation_canceled)
319  {
320  const std::shared_ptr<client> self = std::move(self_);
321  self->strand_.dispatch([self] ()
322  {
323  if (self && self->proxy_.is_open())
324  {
325  self->proxy_.shutdown(boost::asio::ip::tcp::socket::shutdown_both);
326  self->proxy_.close();
327  }
328  });
329  }
330  }
std::shared_ptr< client > self_
Definition: socks.h:201
error
Possible errors with socks communication. Defined in https://www.openssh.com/txt/socks4.protocol.
Definition: socks.h:65
const T & move(const T &t)
Definition: gtest-port.h:1317
Here is the call graph for this function:

Member Data Documentation

◆ self_

std::shared_ptr<client> net::socks::client::async_close::self_

Definition at line 201 of file socks.h.


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