pion::net::TCPStream Class Reference

#include <TCPStream.hpp>

Inherits std::basic_iostream< char, std::char_traits< char > >.

List of all members.


Detailed Description

TCPStream: std::basic_iostream wrapper for TCP network connections

Definition at line 323 of file TCPStream.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

 TCPStream (TCPConnectionPtr &conn_ptr)
 TCPStream (boost::asio::io_service &io_service, const bool ssl_flag=false)
 TCPStream (boost::asio::io_service &io_service, TCPConnection::SSLContext &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
bool is_open (void) const
 returns true if the connection is currently open
bool getSSLFlag (void) const
 returns true if the connection is encrypted using SSL
boost::asio::ip::address getRemoteIp (void) const
 returns the client's IP address
TCPStreamBufferrdbuf (void)
 returns a pointer to the stream buffer in use


Constructor & Destructor Documentation

pion::net::TCPStream::TCPStream ( TCPConnectionPtr conn_ptr  )  [inline, explicit]

constructs a TCP stream object for an existing TCP connection

Parameters:
conn_ptr pointer to the TCP connection to use for reading & writing

Definition at line 341 of file TCPStream.hpp.

pion::net::TCPStream::TCPStream ( boost::asio::io_service &  io_service,
const bool  ssl_flag = false 
) [inline, explicit]

constructs a TCP stream object for a new TCP connection

Parameters:
io_service asio service associated with the connection
ssl_flag if true then the connection will be encrypted using SSL

Definition at line 357 of file TCPStream.hpp.

pion::net::TCPStream::TCPStream ( boost::asio::io_service &  io_service,
TCPConnection::SSLContext ssl_context 
) [inline]

constructs a TCP stream object for a new SSL/TCP connection

Parameters:
io_service asio service associated with the connection
ssl_context asio ssl context associated with the connection

Definition at line 374 of file TCPStream.hpp.


Member Function Documentation

boost::system::error_code pion::net::TCPStream::accept ( boost::asio::ip::tcp::acceptor &  tcp_acceptor  )  [inline]

accepts a new tcp connection and performs SSL handshake if necessary

Parameters:
tcp_acceptor object used to accept new connections
Returns:
boost::system::error_code contains error code if the connection fails
See also:
boost::asio::basic_socket_acceptor::accept()

Definition at line 393 of file TCPStream.hpp.

References pion::net::TCPConnection::accept(), pion::net::TCPStreamBuffer::getConnection(), and pion::net::TCPConnection::handshake_server().

boost::system::error_code pion::net::TCPStream::connect ( const boost::asio::ip::address &  remote_addr,
const unsigned int  remote_port 
) [inline]

connects to a (IPv4) remote endpoint and performs SSL handshake if necessary

Parameters:
remote_addr remote IP address (v4) to connect to
remote_port remote port number to connect to
Returns:
boost::system::error_code contains error code if the connection fails
See also:
boost::asio::basic_socket_acceptor::connect()

Definition at line 424 of file TCPStream.hpp.

References pion::net::TCPConnection::connect(), pion::net::TCPStreamBuffer::getConnection(), and pion::net::TCPConnection::handshake_client().

boost::system::error_code pion::net::TCPStream::connect ( boost::asio::ip::tcp::endpoint &  tcp_endpoint  )  [inline]

connects to a remote endpoint and performs SSL handshake if necessary

Parameters:
tcp_endpoint remote endpoint to connect to
Returns:
boost::system::error_code contains error code if the connection fails
See also:
boost::asio::basic_socket_acceptor::connect()

Definition at line 408 of file TCPStream.hpp.

References pion::net::TCPConnection::connect(), pion::net::TCPStreamBuffer::getConnection(), and pion::net::TCPConnection::handshake_client().


The documentation for this class was generated from the following file:
Generated on Fri Apr 30 14:48:54 2010 for pion-net by  doxygen 1.4.7