Detecting/Signalling reconnection from client side
Posted: Fri Nov 01, 2013 4:15 pm
Hi Jarl,
we have the following problem :
A RCF client connects to a RCF server via TCP. After connection has been established the first thing that happens is some kind of initialization. The RCF server constructs a session object and stores the necessary information about the client. After that the client periodically sends messages the server has to process.
Now consider a restart of the RCF server. The TCP connection will be reestablished after restart of the RCF server and the client may not even notice that there has been such an event (RCF internals quite do but IMHO 'we' don't). Unfortunately the RCF server lost all the initialization stuff and is no longer able to process the incoming messages.
First idea we came up with was that the RCF server will throw an exception to signal the client side that the initialization has not taken place. The major drawback of this approach is that in case you would like to handle this in some kind of intermediate layer (the top layer maybe doesn't even know that RCF is used as a work horse), you would need to place an exception handling around every single method used to forward the information to the server. Even worse some of the methods are defined as oneway for performance reasons ...
Obviously we are looking for a smarter, more elegant solution.
I'm sure you can help us !
Regards,
Volker
we have the following problem :
A RCF client connects to a RCF server via TCP. After connection has been established the first thing that happens is some kind of initialization. The RCF server constructs a session object and stores the necessary information about the client. After that the client periodically sends messages the server has to process.
Now consider a restart of the RCF server. The TCP connection will be reestablished after restart of the RCF server and the client may not even notice that there has been such an event (RCF internals quite do but IMHO 'we' don't). Unfortunately the RCF server lost all the initialization stuff and is no longer able to process the incoming messages.
First idea we came up with was that the RCF server will throw an exception to signal the client side that the initialization has not taken place. The major drawback of this approach is that in case you would like to handle this in some kind of intermediate layer (the top layer maybe doesn't even know that RCF is used as a work horse), you would need to place an exception handling around every single method used to forward the information to the server. Even worse some of the methods are defined as oneway for performance reasons ...
Obviously we are looking for a smarter, more elegant solution.
I'm sure you can help us !
Regards,
Volker