These are chat archives for IndySockets/Indy

7th
Mar 2017
Sergey
@icegood
Mar 07 2017 08:55
Hi there!
I have a question regarding latest build of Indy Sockets for VCL:
In IdIOHandler in all versions of Read/Write for integers we have parameter AConvert: Boolean = True . I wonder in which cases it is useful to have AConvert= False? If we are interest in reliable tcp/ip protocol we have to run pairs of HostToNetwork and NetworkToHost calls. I mean we shouldn't do any assumptions about endianness of both client and server.
Sergey
@icegood
Mar 07 2017 10:15
I also converting one project fro indy9 to indy10. And i wonder, whether should i create new component ioHandler (i beleive TIdIOHandlerStack) for old TIdFTP component? Or Indy does it for me?
mezen
@mezen
Mar 07 2017 13:55
If you dont set an explicit IOHandler to your component (TidTFP, TidHTTP, etc.), Indy creates an own default IOHandler. But if you need TLS Support, you have to set an openssl io handler.
Remy Lebeau
@rlebeau
Mar 07 2017 17:54
@icegood MOST binary-oriented protocols want multi-byte integers to be transmitted in network byte order, so AConvert defaults to True to ensure outgoing integers are sent in network byte order, and incoming integers are returned in host byte order. But, there are some protocols that don't specify/require network byte ordering. AConvert is provided as an option for those cases where integers are not transmitted in network byte order. Yes, that is rare, but such protocols do exist.
@mezen that is typically true. However, to be more accurate, you are not limited to just OpenSSL, any SSL IOHandler will do, OpenSSL is just the default provided by Indy. And while all Indy TCP clients will create and assign a default non-SSL IOHandler object for you if one is not already assigned, there is currently only one component, TIdHTTP, that will actually create a default SSL IOHandler object for you.