Library: Remoting/Binary
Package: Binary
Header: Poco/Remoting/Binary/Listener.h
This class implements the Listener for the Binary Transport.
The listener uses a Poco::Net::TCPServer to accept incoming connections.
Direct Base Classes: Poco::Remoting::Listener
All Base Classes: Poco::Remoting::Listener
Member Functions: getTransportId, invoke, registerObject, start, stop, unregisterObject
Inherited Functions: getLocalEndPoint, getTransportId, registerObject, start, stop, unregisterObject
Listener(
Poco::UInt16 port,
Poco::Net::TCPServerParams::Ptr pParams = 0
);
Creates the Listener for the given port number.
A Poco::Net::TCPServer is set up using a Poco::Net::ServerSocket for the given port number and the Poco::Net::TCPServerParams object.
Listener(
const Poco::Net::ServerSocket & sock,
Poco::Net::TCPServerParams::Ptr pParams = 0
);
Creates the listener using the given server socket.
If the given socket is a Poco::Net::SecureServerSocket, the listener uses a secure SSL/TLS connection.
A Poco::Net::TCPServer is set up using the given server socket and Poco::Net::TCPServerParams object.
~Listener();
Destroys the Listener.
const std::string & getTransportId() const;
Returns the transportId.
bool invoke(
BinaryStream & stream,
Poco::Remoting::Transport & trans
);
Returns false if a fatal error occurs, fatal errors are errors which require to close the connection immediately, an exception while executing is not fatal and will be consumed by this method
void registerObject(
Poco::AutoPtr < Poco::Remoting::RemoteObject > ptrObj,
Poco::AutoPtr < Poco::Remoting::Skeleton > ptrSkel,
const Poco::Remoting::Identifiable::ObjectId & oid,
const Poco::Remoting::Identifiable::TypeId & tid,
bool secure
);
Adds an object to the listener. Depending on the protocol, the Listener can opt to let the ORB handle all invocations (i.e we have a protocol where we can send the fullURI with the request, which allows to implement a requesthandler that simply calls ORB::invoke. In this case, registerObject and unregisterObject can have an empty implementation.
void start();
Starts accepting requests.
See also: Poco::Remoting::Listener::start()
void stop();
Stops accepting requests.
See also: Poco::Remoting::Listener::stop()
void unregisterObject(
Poco::AutoPtr < Poco::Remoting::RemoteObject > ptrObj
);
Unregisters the given object.