Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 124295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:25:22+00:00 2026-05-11T04:25:22+00:00

I am messing around with the Indy 10 supplied with Delphi 2009 and am

  • 0

I am messing around with the Indy 10 supplied with Delphi 2009 and am having trouble with getting all the data from the IOHandler when OnExecute fires…

procedure TFormMain.IdTCPServerExecute(AContext: TIdContext); var   RxBufStr: UTF8String;   RxBufSize: Integer; begin    if AContext.Connection.IOHandler.Readable then   begin     RxBufSize := AContext.Connection.IOHandler.InputBuffer.Size;     if RxBufSize > 0 then     begin       SetLength(RxBufStr, RxBufSize);       AContext.Connection.IOHandler.ReadBytes(TBytes(RxBufStr), RxBufSize, False);     end;   end;  end; 

AContext.Connection.IOHandler.InputBuffer.Size doesn’t seem reliable and often returns 0, but on the next run throug the OnExecute it’ll pick up the right number of bytes, but that is too late.

Essentially I want to be able to just grab all the data, stuff it into a UTF8String (not a Unicode string) and then parse for a special marker. So I have no headers and messages are variable length. It seems the Indy 10 IOHandlers are not setup for this or I am just using it wrong.

It would be nice to do something like pass a buffer of a certain size, fill it as much as possible and return the number of bytes actually filled and then keep going if there are more.

As an aside what’s the status of TIdSchedulerOfFiber, this looks very interesting, does it work? Is anyone using it? I notice that it isn’t in the standard install of Delphi 2009 though.

Update: I found Msg := AContext.Connection.IOHandler.ReadLn(#0, enUTF8); which works but I still would like to know the answer to the above question, is it because it is based on blocking IO? Which makes even more keen on this TIdSchedulerOfFiber.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:25:23+00:00Added an answer on May 11, 2026 at 4:25 am

    You should not be using Readable() like that. Try the following instead:

    procedure TFormMain.IdTCPServerExecute(AContext: TIdContext); var   RxBuf: TIdBytes; begin   RxBuf := nil;   with AContext.Connection.IOHandler do   begin     CheckForDataOnSource(10);     if not InputBufferIsEmpty then     begin       InputBuffer.ExtractToBytes(RxBuf);       // process RxBuf as needed...     end;   end; end; 

    Alternatively:

    procedure TFormMain.IdTCPServerExecute(AContext: TIdContext); var   RxBufStr: String; // not UTF8String begin   with AContext.Connection.IOHandler do   begin     CheckForDataOnSource(10);     if not InputBufferIsEmpty then     begin       RxBufStr := InputBuffer.Extract(-1, enUtf8);        // Alternatively to above, you can set the       // InputBuffer.Encoding property to enUtf8       // beforehand, and then call TIdBuffer.Extract()       // without any parameters.       //       // Or, set the IOHandler.DefStringEncoding       // property to enUtf8 beforehand, and then       // call TIdIOHandler.InputBufferAsString()        // process RxBufStr as needed...     end;   end; end; 

    As for TIdSchedulerOfFiber – the SuperCore package is effectively dead at this time. It has not been worked on in a very long time, and is not up-to-date with the latest Indy 10 architecture. We may try to resurrect it at a later date, but it is not in our plans for the near future.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been messing around with javascriptmvc. After getting data from the model, the view
I'm messing around with magento and I'm having trouble figuring out how to add
I'm messing around with porting an image selection tool into jQuery. I'm having a
I've been messing around all day trying to find why my query performance is
I have been messing around with iTunes COM from python. However, I haven't been
I'm messing around with some C code using floats, and I'm getting 1.#INF00, -1.#IND00
While messing around with the custom formatting options in Eclipse, in one of the
I've been messing around with this for hours trying different ways of ordering by
I've been messing around with some coding and finally think I'm finally ready for
I am messing around with Session in my webapp at the moment and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.