Client just freezes if other kind of server (not RO) is listening to the port

delphi

(Marcos Cunha Lima) #1

Using Delphi Berlin v2 and RO.
The server is an TROHttpServer and the client uses a TRoIndyHttpChannel with a TROBinMessage (very simple server and client).

We are migrating all the code from other server (Asta) to RO.

This means that we have some Asta Servers and RO Servers running in the same server (obviously at different ports and all works well) while we are not finishing the migration.

The problem happens when our client RO tries to connects to a supposed RO server but its address is misconfigured and it gets the Asta address instead. When it tries to connect, it just freezes. We expected that it could throw an error (like the error it throws when there is no server at this address).

Is there any configuration that we should change in order to, when a client is trying to connect to a “foreign” server, it throws an error and don’t try anything else?

When I say “it freezes” what I am trying to say is that the client executes some RO code that the debugger cannot access and does not return to the next line after the connection.


(EvgenyK) #2

each client has OnException event. try to use it.
if it doesn’t raise any exception, try to change TimeOut.
in Indy, it is -1, i.e. IdTimeoutDefault value

another workaround - try to replace TROIndyHttpChannel with another plain http channel like TROWinInetHTTPChannel, TROSynapseHTTPChannel or TRONetHttpClientChannel.


(Marcos Cunha Lima) #3

So, it worked changing the timeout of the channel:

 FCanal := TROIndyHTTPChannel.Create(nil);
 FCanal.Timeout := 3000;    // 3 seconds

Is this ok, eg, it’s the same timeout that you thought?


(EvgenyK) #4

it up to your decision. other http channels have 90 sec timeout