ChannelMatchingTargetURL suggestion

delphi
(estebanp) #1

Hi there,

Tokyo, RODA 9.4.

if you do something like

fChannel := TROTransportChannel.ChannelMatchingTargetUrl(fURI);

even if you have defined an initialization section on a unit with

initialization
ROUrlSchemaParser.ProtocolHandler[‘local’] := TROLocalChannel;
ROUrlSchemaParser.ProtocolHandler[‘supertcp2’] := TROSynapseSuperTCPChannel;

if it receives something like “supertcp://something.com/bin” and I dont have the unit uROSuperTCPChannel defined wherever I’m creating the channel, it will use anything available e.g. Synapse, instead of raising some sort of error or warning.

The issue is that if by any chance while creating this channels by code the developer doesnt include the units of all the channels it will pick whatever is available. So we ended up with several parts of our system creating/using a mix of Synapse and Indy on their channels just because on some there was uROSynapseSuperTCPChannel and others uROSuperTCPChannel declared on the unit section.

I suggest raising an exception or warning if the defined schema doesnt match with the type available.

0 Likes

(EvgenyK) #2

Hi,

If you are using RemoteDataAdapter, it includes Indy channels for supporting simplified RDA setup:

  uROIndyHTTPChannel,       //default http
  uROIndySuperHttpChannel,  //default superhttp
  uROIndyTCPChannel,        //default tcp
  uROIndyUDPChannel,        //default udp
  uROSuperTCPChannel,       //default supertcp

it may be a reason for such behavior.

0 Likes