PionNetworkLibrary
|
#include <stream.hpp>
Public Types | |
typedef char | char_type |
typedef std::char_traits< char > ::int_type | int_type |
typedef std::char_traits< char > ::off_type | off_type |
typedef std::char_traits< char > ::pos_type | pos_type |
typedef std::char_traits< char > | traits_type |
Public Member Functions | |
stream (const tcp::connection_ptr &conn_ptr) | |
stream (boost::asio::io_service &io_service, const bool ssl_flag=false) | |
stream (boost::asio::io_service &io_service, connection::ssl_context_type &ssl_context) | |
boost::system::error_code | accept (boost::asio::ip::tcp::acceptor &tcp_acceptor) |
boost::system::error_code | connect (boost::asio::ip::tcp::endpoint &tcp_endpoint) |
boost::system::error_code | connect (const boost::asio::ip::address &remote_addr, const unsigned int remote_port) |
void | close (void) |
closes the tcp connection More... | |
bool | is_open (void) const |
returns true if the connection is currently open More... | |
bool | get_ssl_flag (void) const |
returns true if the connection is encrypted using SSL More... | |
boost::asio::ip::address | get_remote_ip (void) const |
returns the client's IP address More... | |
stream_buffer * | rdbuf (void) |
returns a pointer to the stream buffer in use More... | |
stream: std::basic_iostream wrapper for TCP network connections
typedef char pion::tcp::stream::char_type |
typedef std::char_traits<char>::int_type pion::tcp::stream::int_type |
typedef std::char_traits<char>::off_type pion::tcp::stream::off_type |
typedef std::char_traits<char>::pos_type pion::tcp::stream::pos_type |
typedef std::char_traits<char> pion::tcp::stream::traits_type |
|
inlineexplicit |
constructs a TCP stream object for an existing TCP connection
conn_ptr | pointer to the TCP connection to use for reading & writing |
|
inlineexplicit |
constructs a TCP stream object for a new TCP connection
io_service | asio service associated with the connection |
ssl_flag | if true then the connection will be encrypted using SSL |
|
inline |
constructs a TCP stream object for a new SSL/TCP connection
io_service | asio service associated with the connection |
ssl_context | asio ssl context associated with the connection |
|
inline |
accepts a new tcp connection and performs SSL handshake if necessary
tcp_acceptor | object used to accept new connections |
References pion::tcp::connection::accept(), pion::tcp::stream_buffer::get_connection(), get_ssl_flag(), and pion::tcp::connection::handshake_server().
|
inline |
closes the tcp connection
References pion::tcp::connection::close(), and pion::tcp::stream_buffer::get_connection().
|
inline |
connects to a remote endpoint and performs SSL handshake if necessary
tcp_endpoint | remote endpoint to connect to |
References pion::tcp::connection::connect(), pion::tcp::stream_buffer::get_connection(), get_ssl_flag(), and pion::tcp::connection::handshake_client().
|
inline |
connects to a (IPv4) remote endpoint and performs SSL handshake if necessary
remote_addr | remote IP address (v4) to connect to |
remote_port | remote port number to connect to |
References pion::tcp::connection::connect(), pion::tcp::stream_buffer::get_connection(), get_ssl_flag(), and pion::tcp::connection::handshake_client().
|
inline |
returns the client's IP address
References pion::tcp::stream_buffer::get_connection(), and pion::tcp::connection::get_remote_ip().
|
inline |
returns true if the connection is encrypted using SSL
References pion::tcp::stream_buffer::get_connection(), and pion::tcp::connection::get_ssl_flag().
|
inline |
returns true if the connection is currently open
References pion::tcp::stream_buffer::get_connection(), and pion::tcp::connection::is_open().
|
inline |
returns a pointer to the stream buffer in use