Client request if Network failure or Server stop, ROSuperTCPChannel can not retry!!!
Select ROSuperTCPChannel, Click Start Test
at client Testing , Click stop server(or Terminate NewServer.exe),
if server is remote, can disconnect the network cable
Client prompt Exception “Timeout” , Plug the Internet cable or start server, Click Yes Retry,
but prompt Exception “Connection Closed Gracefully.” and can not retry!!
Change given test project please and retest it : set for TROSuperTCPChannel AutoReconnect property to True and comment channel disconnection before doing retry
if Application.MessageBox(PWideChar(vMsg), '', 36) = ID_YES then
begin
//ROSuperTCPChannel.Client.Disconnect;
aRetry := True;
end;
I’m really sorry for this prolonged investigation. We have boosted the priority of this issue to react faster on this from now on.
So what’s found. First, there is a problem regarding OnException event and superchannels. If the connection has been broken on the communication level superchannels must follow the special procedure to reestablish it. Just sending the recent package again doesn’t work. That’s why this event usage is limited to plain channels or exceptions related to business logic. It is logged and will be fixed sooner or later.
The workaround. Using AutoReconnect = true seems to be the best solution in this case. The AutoReconnect logic takes care of all required connection reestablish procedures and does it in background. Turn this property on in the designer and let it it do it’s job. I have tested your application carefully following your instructions - it does not freeze and behaves as expected. In real life there is a chance of race condition so please check server’s Connected property before retrying the request to make sure the connection established (anyway retrying with the disconnected channel makes little sense).
Hello,
ROSuperTCPChannel.RequestTimeout is time in milliseconds and it should be more than sleep.
Please set Sleep(60000) and ROSuperTCPChannel.RequestTimeout =60100,
Hi, if I discover that the server had freeze, destroy the component and recreate it manually, should work?? If yes how can I find out that server is dead? Or that somehow connection is not working anymore?