Initial naive conversion to use Indy TidTCPClient rather than TTCPClient. Could possibly be made more efficient by using TidTCPClient in a more Indy-like fashion, but right now I just translated it as directly as possible.