These are chat archives for IndySockets/Indy

Feb 2018
Feb 05 2018 00:55
Another problem. It seems that most recent Linux distributions allow binding IPv4 and IPv6 on the same port concurrently. Will the implementation of adding bindings in TIdCustomTCPServer.Startup become more flexible in the future?
Remy Lebeau
Feb 05 2018 18:27
@mercedwang I don't see how your ReadBytes() implementation is much better than the current TIdIOHandler.ReadBytes() implementation. If you set a non-inifinite positive ReadTimeout, an EIdReadTimeout should already be getting raised by TIdIOHandler.ReadBytes() if no data arrives in the specified time period. Otherwise it blocks indefinately waiting for data (well, Indy actually blocks indefinately, yours unblocks after 24 days). All you are really doing is creating a similar loop to the one that already exists in TIdIOHandler.ReadFromSource(), except that you are forcing the loop to wake up every 5 seconds, whereas Indy lets the OS decide when to wake up. As for the Bindings collection, how much more flexible do you want it to be? It already allow you to bind IPv4 and IPv6 sockets concurrently on the same port, if that is supported by the OS. TIdCustomTCPServer.Startup() simply adds default listening sockets if you don't specify your own bindings beforehand. If you want more control, just setup the Bindings collection yourself how you want before activating the server