long GetTimeout(void) const
Return the timeout.
virtual GPL_Boolean IsConnected(void) const
Return TRUE if the client is connected to the server. Return
FALSE otherwise.
void SetTimeout(const long t)
Set the timeout used for waiting to t.
virtual GPL_Boolean Initialize(void)
Initialize the client. This must be called before the first call to
Request() or Reply() . Return TRUE if the initialization
succeeded. Return FALSE if the initialization failed.
virtual void Finalize(void)
Finalize the client.
virtual GPL_Boolean Reconnect(void)
Clean up a broken connection and attempt reconnection to the server.
Return TRUE if the reconnection succeeded. Return FALSE if
the reconnection failed.
void SetDestination(DNA_IPPoint *d)
Set the address of the server to d.
void SetImp(DNA_UDPBindingImp *i)
Set the implementation used to i. The default implementation is an
instance of DNA_TCPConnectionImp.
virtual void Process(void)
Check for any messages on the connection. While a message is received
from the connection, call ProcessMessage() for that message.
virtual void ProcessMessage(DNA_Message & message)
Process the message message that was received from the connection.
By default, the message handlers are invoked in order until one of them
handles the message and marks it as consumed. Handlers which expire
are removed from the handler list. Sub-classes that wish to perform
additional processing should over-ride this function.
virtual GPL_Boolean Request(DNA_Message & message)
Send the request message to the server. Return TRUE if the
send succeeds and FALSE if it fails.
virtual GPL_Boolean Reply(DNA_Message & message)
Send the reply message to the server. Return TRUE if the
send succeeds and FALSE if it fails.
virtual GPL_Boolean Receive(DNA_Message & message)
Receive a message from the server. Return TRUE if the
receive succeeds and FALSE if it fails. This call implies a synchronous
behavior. Although not mutually exclusive with the supported asynchronous
handler based paradigm, care should be taken if mixing the two.
virtual unsigned long GetNumberHandlers(void) const
Return the number of installed message handlers.
virtual void AppendHandler(const GPL_Pointer<DNA_MessageHandler> & handler)
Append the message handler, handler to the list of message
handlers.
virtual void InsertHandler(const GPL_Pointer<DNA_MessageHandler> & handler, const unsigned long at)
Insert the message handler, handler at position at in the list
of message handlers.