#include <CastorChannel.h>
Public Member Functions | |
virtual void | accept ()=0 throw (NetException) |
virtual void | bind ()=0 |
CastorChannel (const CastorChannel &other) | |
virtual void | close ()=0 throw (NetException) |
virtual void | close (const NetAddress &address)=0 throw (NetException) |
virtual void | connect ()=0 throw (NetException) |
virtual void | enableBroadcast (bool on)=0 |
virtual bool | enableBroadcast ()=0 |
virtual void | enableLoopback (bool on)=0 |
virtual bool | enableLoopback ()=0 |
NetAddress & | getAddress () |
asio::mutable_buffers_1 | getBuffer () |
asio::io_service & | getIoService () |
virtual NetAddress | getLocalAddress ()=0 |
bool | isAsync () |
virtual bool | isOpen ()=0 |
void | join () |
virtual void | joinGroup (const asio::ip::address &address)=0 |
virtual void | leaveGroup (const asio::ip::address &address)=0 |
virtual void | multicastHops (int hops)=0 |
virtual int | multicastHops ()=0 |
virtual void | open ()=0 |
virtual void | open (const NetAddress &a)=0 |
virtual size_t | receive (char *data, size_t length)=0 |
virtual size_t | receive (char *data, size_t length, NetAddress &remote)=0 |
void | registerCallback (CCallbackPtr cb) |
virtual void | reuseAddress (bool on)=0 |
virtual bool | reuseAddress ()=0 |
void | run () |
virtual void | send (const char *data, size_t length)=0 |
virtual void | send (const char *data, size_t length, const NetAddress &remote)=0 |
virtual void | setAsync (bool value)=0 |
void | start () |
virtual | ~CastorChannel () |
Public Attributes | |
CastorChannelCallback | callback |
CastorChannelExtCallback | callbackExt |
Event | connectionEstablished |
Event | connectionLost |
Event | peerAdded |
Event | peerRemoved |
Protected Types | |
enum | { mode_undefined, mode_accept, mode_connect } |
typedef std::set< NetAddress > | AddressSet |
typedef std::map< std::string, NetInterfacePtr > | InterfaceMap |
typedef boost::shared_ptr < asio::thread > | ThreadType |
Protected Member Functions | |
CastorChannel (asio::io_service &service) | |
void | getIfaddrs () |
void | signalReceive (const char *buffer, size_t count, NetAddressPtr address) |
Static Protected Member Functions | |
static CastorChannelPtr | create (asio::io_service &service, const std::string spec) throw (NetException) |
static CastorChannelPtr | create (asio::io_service &service, const NetAddress &address) throw (NetException) |
Protected Attributes | |
NetAddress | address |
bool | async |
char | buffer [8192] |
CCallbackPtr | cb |
bool | closed |
InterfaceMap | interfaces |
AddressSet | localAddresses |
enum castor::net::CastorChannel:: { ... } | mode |
asio::io_service * | service |
asio::io_service::strand | strand |
ThreadType | thread |
Friends | |
class | Communication |
Definition at line 47 of file CastorChannel.h.
typedef std::set<NetAddress> castor::net::CastorChannel::AddressSet [protected] |
Definition at line 84 of file CastorChannel.h.
typedef std::map<std::string, NetInterfacePtr> castor::net::CastorChannel::InterfaceMap [protected] |
Definition at line 83 of file CastorChannel.h.
typedef boost::shared_ptr<asio::thread> castor::net::CastorChannel::ThreadType [protected] |
Definition at line 55 of file CastorChannel.h.
anonymous enum [protected] |
Definition at line 74 of file CastorChannel.h.
castor::net::CastorChannel::CastorChannel | ( | asio::io_service & | service | ) | [protected] |
Definition at line 8 of file CastorChannel.cpp.
castor::net::CastorChannel::CastorChannel | ( | const CastorChannel & | other | ) |
Definition at line 17 of file CastorChannel.cpp.
castor::net::CastorChannel::~CastorChannel | ( | ) | [virtual] |
Definition at line 29 of file CastorChannel.cpp.
virtual void castor::net::CastorChannel::accept | ( | ) | throw (NetException) [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual void castor::net::CastorChannel::bind | ( | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual void castor::net::CastorChannel::close | ( | ) | throw (NetException) [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual void castor::net::CastorChannel::close | ( | const NetAddress & | address | ) | throw (NetException) [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual void castor::net::CastorChannel::connect | ( | ) | throw (NetException) [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
CastorChannelPtr castor::net::CastorChannel::create | ( | asio::io_service & | service, |
const std::string | spec | ||
) | throw (NetException) [static, protected] |
Definition at line 76 of file CastorChannel.cpp.
CastorChannelPtr castor::net::CastorChannel::create | ( | asio::io_service & | service, |
const NetAddress & | address | ||
) | throw (NetException) [static, protected] |
Definition at line 83 of file CastorChannel.cpp.
virtual void castor::net::CastorChannel::enableBroadcast | ( | bool | on | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual bool castor::net::CastorChannel::enableBroadcast | ( | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual void castor::net::CastorChannel::enableLoopback | ( | bool | on | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual bool castor::net::CastorChannel::enableLoopback | ( | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
Definition at line 136 of file CastorChannel.cpp.
Definition at line 99 of file CastorChannel.cpp.
void castor::net::CastorChannel::getIfaddrs | ( | ) | [protected] |
Definition at line 32 of file CastorChannel.cpp.
Definition at line 105 of file CastorChannel.cpp.
virtual NetAddress castor::net::CastorChannel::getLocalAddress | ( | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
bool castor::net::CastorChannel::isAsync | ( | ) | [inline] |
Definition at line 122 of file CastorChannel.h.
virtual bool castor::net::CastorChannel::isOpen | ( | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
void castor::net::CastorChannel::join | ( | ) |
Definition at line 126 of file CastorChannel.cpp.
virtual void castor::net::CastorChannel::joinGroup | ( | const asio::ip::address & | address | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual void castor::net::CastorChannel::leaveGroup | ( | const asio::ip::address & | address | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual void castor::net::CastorChannel::multicastHops | ( | int | hops | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual int castor::net::CastorChannel::multicastHops | ( | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual void castor::net::CastorChannel::open | ( | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual void castor::net::CastorChannel::open | ( | const NetAddress & | a | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual size_t castor::net::CastorChannel::receive | ( | char * | data, |
size_t | length | ||
) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual size_t castor::net::CastorChannel::receive | ( | char * | data, |
size_t | length, | ||
NetAddress & | remote | ||
) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
Definition at line 59 of file CastorChannel.cpp.
virtual void castor::net::CastorChannel::reuseAddress | ( | bool | on | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual bool castor::net::CastorChannel::reuseAddress | ( | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
void castor::net::CastorChannel::run | ( | ) |
Definition at line 115 of file CastorChannel.cpp.
virtual void castor::net::CastorChannel::send | ( | const char * | data, |
size_t | length | ||
) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual void castor::net::CastorChannel::send | ( | const char * | data, |
size_t | length, | ||
const NetAddress & | remote | ||
) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
virtual void castor::net::CastorChannel::setAsync | ( | bool | value | ) | [pure virtual] |
Implemented in castor::net::channels::Tcp, and castor::net::channels::Udp.
void castor::net::CastorChannel::signalReceive | ( | const char * | buffer, |
size_t | count, | ||
NetAddressPtr | address | ||
) | [inline, protected] |
Definition at line 64 of file CastorChannel.h.
void castor::net::CastorChannel::start | ( | ) |
Definition at line 109 of file CastorChannel.cpp.
friend class Communication [friend] |
Definition at line 81 of file CastorChannel.h.
NetAddress castor::net::CastorChannel::address [protected] |
Definition at line 51 of file CastorChannel.h.
bool castor::net::CastorChannel::async [protected] |
Definition at line 90 of file CastorChannel.h.
char castor::net::CastorChannel::buffer[8192] [protected] |
Definition at line 53 of file CastorChannel.h.
Definition at line 96 of file CastorChannel.h.
Definition at line 97 of file CastorChannel.h.
CCallbackPtr castor::net::CastorChannel::cb [protected] |
Definition at line 76 of file CastorChannel.h.
bool castor::net::CastorChannel::closed [protected] |
Definition at line 89 of file CastorChannel.h.
Definition at line 103 of file CastorChannel.h.
Definition at line 102 of file CastorChannel.h.
InterfaceMap castor::net::CastorChannel::interfaces [protected] |
Definition at line 86 of file CastorChannel.h.
AddressSet castor::net::CastorChannel::localAddresses [protected] |
Definition at line 87 of file CastorChannel.h.
enum { ... } castor::net::CastorChannel::mode [protected] |
Definition at line 99 of file CastorChannel.h.
Definition at line 100 of file CastorChannel.h.
asio::io_service* castor::net::CastorChannel::service [protected] |
Reimplemented in castor::net::channels::Tcp.
Definition at line 57 of file CastorChannel.h.
Definition at line 58 of file CastorChannel.h.
ThreadType castor::net::CastorChannel::thread [protected] |
Definition at line 60 of file CastorChannel.h.