I’m sorry. Sometimes i feel like a real beginner. I don’t see the solution right now.
Delphi 11.1 , RO 10.0.0.1537
place a TROSynapseSuperTCPChannel on the form.
place a button on the form.
assign channel.OnException.
set Channel.Autoreconnect to true
set host and port to a not existing server
set channel.active to true
Now neither a try/except over channel.active := true nor channel.onexception will catch the exception ESynapseError “Connection refused”.
In unit uROSynapseSuperTCPChannel.pas the exception has been raised. But i don’t see how to catch it?
procedure TROSynapseClientSuperConnection.Client_Connect(const aHost: string; const aPort: Integer; aSSL: Boolean);
begin
Connection.Connect(aHost, IntToStr(aPort));
if Connection.LastError <> 0 then raise ESynapseError.Create(Connection.LastErrorDesc);
if aSSL then Connection.SSLDoConnect;
if Connection.LastError <> 0 then raise ESynapseError.Create(Connection.LastErrorDesc);
end;
Evgeny,
Also this is not working in my environment. Please start the attached very basic sample (just a channel, no server locator). In my environment no exception will be chatched. In Debugger i get the exception in the IDE as you see in the screenshot at my previous post. Outside nothing happens. Why is that? What if you hit the button in the test sample?
O.K i see. In my opinion this design is not useful. I would expect a channel exception also on enabled autoreconnect property? One has two know at least the first time if something get wrong and why.
Another question related to this: In the given sample - its not possible to close the application after set channel.active to True. Even if i set channel.active to false in form destroy. Neither if autoreconnect is set to true nor if one set aRetry := True in the channel exception. I thought this was possible in former versions?