Library: Remoting
Package: Transport
Header: Poco/Remoting/TransportManager.h
A TransportManager manages all existing TransportFactory objects.
Member Functions: create, hasFactory, instance, registerFactory, unregisterFactory
~TransportManager();
Destroys the TransportManager.
Transport * create(
const std::string & protocol
);
Creates a transport for the given protocol. The transport itself is still uninitialized. Call transport->connect(endPoint) to make it usable! Throws an exception if the protocol is unknown
Transport * create(
const std::string & protocol,
const std::string & endPoint
);
Creates a connected transport for the given protocol. Throws an exception if the protocol is unknown.
bool hasFactory(
const std::string & protocol
) const;
Returns true if for the protocol a factory was registered.
static TransportManager & instance();
Returns a reference to the singleton.
void registerFactory(
const std::string & protocol,
TransportFactory * pFactory
);
Registers the factory if it doesn't exist yet. Always takes ownership of the pointer.
void unregisterFactory(
const std::string & protocol
);
Removes the factory from the manager. If for the given protocol no factory is found, the error is silently ignored.