Does Indy10 have the same functionality as TIdTCPConnection.ReadFromStack?

Asked 2 years ago, Updated 2 years ago, 110 views

Indy 9 Program

 void__fastcall TfrmMain::ServerConnect (TIdPeerThread*AThread)
{
-----------------------------------------------------------
    TIdTCPServerConnection* con=AThread->Connection;
-----------------------------------------------------------
       intiExpectedLen=0, iStackBufSize=0;
-----------------------------------------------------------
       iStackBufSize=con->ReadFromStack(true, 5000, true);
-----------------------------------------------------------
}

I'd like to move this program to Indy10, but I can't find ReadFromStack when I search for keywords in Indy10's manual. Do you have any equivalent features?

delphi

2022-09-30 21:43

1 Answers

There's an article like this:
Upgrade Indy9 to Indy10
Questions

I want to upgrade my application from Indy 9 to 10 with Delphi 2007. There is a lot of issues in this, I have read the indie doc about changes but I still need advice. This won't compile as ReadString is not found.

vCmdHead:=FTCPCclient.ReadString(16);

where FTCPCClient is of type TIdTCPCClient.vCmdHead is a structure that contains a command as a string. What method could I use installed?

Answer

{$IFDEFINDY10}
  ALine: =IdTCPCClient.IOHandler.ReadString(16);
  {$ELSE}
  Aline: = IdTCPCClient.ReadString(16);
  {$ENDIF}

Something like this

Other articles like this:
Upgrading Delphi 7 Indy 9 app to Indy 10(II)

It seems that this is the case in that analogy.
TidIOHandlerStack Class
TidIOHandlerStack Members
TidIOHandler.ReadBytes Method

TIdTCPConnection Class
TIdTCPConnection Members
TIdTCPConnection.CreateIOHandler Method
TIdTCPConnection.IOHandler Property
TIdTCPConnection.ManagedIOHandler Property

Find out if it's actually related or how to use it.

Read the article for Indy9's affected methods here.
TIdTCPConnection.ReadFromStack


2022-09-30 21:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.