#include <Tcp.h>
Classes | |
class | Connection |
Public Member Functions | |
virtual void | accept () throw (NetException) |
virtual void | bind () |
virtual void | close () throw (NetException) |
virtual void | close (const NetAddress &address) throw (NetException) |
virtual void | connect () throw (NetException) |
virtual void | enableBroadcast (bool on) |
virtual bool | enableBroadcast () |
virtual void | enableLoopback (bool on) |
virtual bool | enableLoopback () |
virtual NetAddress | getLocalAddress () |
virtual bool | isOpen () |
virtual void | joinGroup (const asio::ip::address &address) |
virtual void | leaveGroup (const asio::ip::address &address) |
virtual void | multicastHops (int hops) |
virtual int | multicastHops () |
virtual void | open () |
virtual void | open (const NetAddress &a) |
virtual size_t | receive (char *data, size_t length) |
virtual size_t | receive (char *data, size_t length, NetAddress &remote) |
virtual void | reuseAddress (bool on) |
virtual bool | reuseAddress () |
virtual void | send (const char *data, size_t length) |
virtual void | send (const char *data, size_t length, const NetAddress &remote) |
virtual void | setAsync (bool async) |
Tcp (asio::io_service &service, const NetAddress &a) | |
virtual | ~Tcp () |
Protected Member Functions | |
void | add (ConnectionPtr connection) |
void | handleAccept (ConnectionPtr connection, const asio::error_code &error) |
void | handleConnect (const asio::error_code &error) |
void | handleRead (const asio::error_code &error, size_t count) |
void | handleSend (const asio::error_code &error, size_t count) |
void | remove (const NetAddress &address) |
Tcp (asio::io_service &service) | |
Private Types | |
typedef std::map< NetAddress, ConnectionPtr > | ConnectionMap |
typedef boost::shared_ptr < Connection > | ConnectionPtr |
Private Attributes | |
asio::ip::tcp::acceptor | acceptor |
ConnectionMap | connections |
asio::ip::tcp::endpoint | endpoint |
boost::mutex | mutex |
bool | opened |
asio::ip::tcp::endpoint | remoteEndpoint |
asio::io_service * | service |
asio::ip::tcp::socket | socket |
typedef std::map<NetAddress, ConnectionPtr> castor::net::channels::Tcp::ConnectionMap [private] |
typedef boost::shared_ptr<Connection> castor::net::channels::Tcp::ConnectionPtr [private] |
castor::net::channels::Tcp::Tcp | ( | asio::io_service & | service | ) | [protected] |
castor::net::channels::Tcp::Tcp | ( | asio::io_service & | service, |
const NetAddress & | a | ||
) |
castor::net::channels::Tcp::~Tcp | ( | ) | [virtual] |
void castor::net::channels::Tcp::accept | ( | ) | throw (NetException) [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::add | ( | ConnectionPtr | connection | ) | [protected] |
void castor::net::channels::Tcp::bind | ( | ) | [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::close | ( | ) | throw (NetException) [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::close | ( | const NetAddress & | address | ) | throw (NetException) [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::connect | ( | ) | throw (NetException) [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::enableBroadcast | ( | bool | on | ) | [virtual] |
Implements castor::net::CastorChannel.
bool castor::net::channels::Tcp::enableBroadcast | ( | ) | [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::enableLoopback | ( | bool | on | ) | [virtual] |
Implements castor::net::CastorChannel.
bool castor::net::channels::Tcp::enableLoopback | ( | ) | [virtual] |
Implements castor::net::CastorChannel.
NetAddress castor::net::channels::Tcp::getLocalAddress | ( | ) | [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::handleAccept | ( | ConnectionPtr | connection, |
const asio::error_code & | error | ||
) | [protected] |
void castor::net::channels::Tcp::handleConnect | ( | const asio::error_code & | error | ) | [protected] |
void castor::net::channels::Tcp::handleRead | ( | const asio::error_code & | error, |
size_t | count | ||
) | [protected] |
void castor::net::channels::Tcp::handleSend | ( | const asio::error_code & | error, |
size_t | count | ||
) | [protected] |
bool castor::net::channels::Tcp::isOpen | ( | ) | [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::joinGroup | ( | const asio::ip::address & | address | ) | [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::leaveGroup | ( | const asio::ip::address & | address | ) | [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::multicastHops | ( | int | hops | ) | [virtual] |
Implements castor::net::CastorChannel.
int castor::net::channels::Tcp::multicastHops | ( | ) | [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::open | ( | ) | [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::open | ( | const NetAddress & | a | ) | [virtual] |
Implements castor::net::CastorChannel.
size_t castor::net::channels::Tcp::receive | ( | char * | data, |
size_t | length | ||
) | [virtual] |
Implements castor::net::CastorChannel.
size_t castor::net::channels::Tcp::receive | ( | char * | data, |
size_t | length, | ||
NetAddress & | remote | ||
) | [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::remove | ( | const NetAddress & | address | ) | [protected] |
void castor::net::channels::Tcp::reuseAddress | ( | bool | on | ) | [virtual] |
Implements castor::net::CastorChannel.
bool castor::net::channels::Tcp::reuseAddress | ( | ) | [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::send | ( | const char * | data, |
size_t | length | ||
) | [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::send | ( | const char * | data, |
size_t | length, | ||
const NetAddress & | remote | ||
) | [virtual] |
Implements castor::net::CastorChannel.
void castor::net::channels::Tcp::setAsync | ( | bool | async | ) | [virtual] |
Implements castor::net::CastorChannel.
boost::mutex castor::net::channels::Tcp::mutex [private] |
bool castor::net::channels::Tcp::opened [private] |
Reimplemented from castor::net::CastorChannel.