21 #include <boost/asio/ip/tcp.hpp>
22 #include <boost/asio/ssl/stream.hpp>
23 #include <boost/system/error_code.hpp>
25 using boost::asio::ip::tcp;
26 namespace boostssl = boost::asio::ssl;
28 template<
class SslContext>
34 _sslSocket.set_verify_mode(boostssl::verify_none);
38 void close(boost::system::error_code& error)
43 void shutdown(boost::asio::socket_base::shutdown_type what, boost::system::error_code& shutdownError)
46 _socket.shutdown(what, shutdownError);
49 template<
typename MutableBufferSequence,
typename ReadHandlerType>
50 void async_read_some(MutableBufferSequence
const& buffers, ReadHandlerType&& handler)
52 _sslSocket.async_read_some(buffers, std::move(handler));
55 template<
typename ConstBufferSequence,
typename WriteHandlerType>
58 _sslSocket.async_write_some(buffers, std::move(handler));
61 template<
typename ConstBufferSequence>
62 std::size_t
write_some(ConstBufferSequence
const& buffers, boost::system::error_code& error)
67 template<
typename SettableSocketOption>
68 void set_option(SettableSocketOption
const& option, boost::system::error_code& error)
70 _socket.set_option(option, error);
75 return _socket.remote_endpoint();
79 template<
typename HandshakeHandlerType>
80 void async_handshake(boostssl::stream_base::handshake_type type, HandshakeHandlerType&& handler)
82 _sslSocket.async_handshake(type, std::move(handler));
90 #endif // SslSocket_h__
void close(boost::system::error_code &error)
Definition: SslSocket.h:38
void async_handshake(boostssl::stream_base::handshake_type type, HandshakeHandlerType &&handler)
Definition: SslSocket.h:80
void set_option(SettableSocketOption const &option, boost::system::error_code &error)
Definition: SslSocket.h:68
Definition: SslSocket.h:29
boostssl::stream< tcp::socket & > _sslSocket
Definition: SslSocket.h:87
SslSocket(tcp::socket &&socket)
Definition: SslSocket.h:32
void async_write_some(ConstBufferSequence const &buffers, WriteHandlerType &&handler)
Definition: SslSocket.h:56
void async_read_some(MutableBufferSequence const &buffers, ReadHandlerType &&handler)
Definition: SslSocket.h:50
tcp::socket _socket
Definition: SslSocket.h:86
tcp::socket::endpoint_type remote_endpoint() const
Definition: SslSocket.h:73
std::size_t write_some(ConstBufferSequence const &buffers, boost::system::error_code &error)
Definition: SslSocket.h:62
void shutdown(boost::asio::socket_base::shutdown_type what, boost::system::error_code &shutdownError)
Definition: SslSocket.h:43