Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Aug : Re: A couple more problems trying to change from indy 9 to indy 10

www.cryer.info
Managed Newsgroup Archive

Re: A couple more problems trying to change from indy 9 to indy 10

Subject:Re: A couple more problems trying to change from indy 9 to indy 10
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Wed, 9 Aug 2006 21:11:19

"Kiwi" <glen@custommadesoftware.co.nz> wrote in message
news:44daaead@newsgroups.borland.com...

> This code no longer compiles as the intercepts are no longer used.

Yes, they are.  They have simply been moved to the IOHandler.  However, the
IOHandler is not assigned by default until after the connection has been
estalished, so you would have to assign your own IOHandler to the connection
before connecting.  Then you can attach the Intercept to the IOHandler.

On the other hand, you must be using an older build of Indy 10, because in
newer builds the Intercept property has already been introduced back into
TIdTCPConnection, so it can be assigned to the connection without having to
manually assign an IOHandler first.

> Any ideas on what to do here.

Upgrade to the latest Indy 10 snapshot.

> This being a simple one I think but cant find the answer to it
>
>       TCPClient.WriteBuffer(Command, SizeOf(Command));
> does not compile in Indy 10

Most of the writing methods have been renamed in Indy 10.  They are now
overloads of the Write() method.  Also, raw memory pointers are no longer
allowed in Indy 10 because of .NET compatibility, so you have to use
TIdBytes now for any memory buffers, ie:

    var
        Buf: TIdBytes;
    begin
        Buf := RawToBytes(Command, SizeOf(Command));
        TCPClient.Write(Buf);
    end;

Did you read the Indy 10 documentation yet?


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive