Search code examples
delphiindy

Where is the WriteInteger / WriteStream methods gone in Indy?


i was viewing an open-source code to learn how to use Indy component in Delphi in this link, and i've noticed some nice methods, but i get ide error's complaining that it does not exist, i am asking this just to make sure, were they available in old version of the Indy, and if so, what is their replacement in the newer version of Indy in Delphi XE ? thank you all.


Solution

  • The code you are looking at was written for Indy 9. XE ships with Indy 10 instead. A lot of things were re-written in Indy 10. Most notably:

    1. TIdPeerThread was replaced with TIdContext, and context management was decoupled from the parent thread (TIdPeerThread is a TThread descendant, but TIdContext is not).
    2. most of the reading/writing methods that were in TIdTCPConnection in Indy 9 were moved to TIdIOHandler in Indy 10, and most writing methods were also renamed into Write() overloads.

    So what you are looking for are AContext.Connection.IOHandler.Write(Integer), AContext.Connection.IOHandler.Write(TStream), etc.