Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIdHTTP Lightstreamer Client
#4
Yes, I've understood this very clearly.
I'd like to thank you again for this explanation.

Another question:

The remote server sends a very large content-size and starts sending data (realtime quotes requested in subsequent posts).

My app receives these data in the Write method of a TStream descendant.

Each data content is terminated with a CR LF.

When content-length is reached, the component is reconnected as explained by the vendor docs.

I can't do any king of pooling or buffering as data consumption must occur ASAP.

To minimize the problem with TIdHTTP receive buffer, I've wrote the following code:

Code:
void __fastcall TLSConexaoHttp::HTTPConnected(TObject *Sender)
{
TIdHTTP * pHTTP = static_cast<TIdHTTP*>(Sender);
pHTTP->IOHandler->WriteBufferFlush();
pHTTP->IOHandler->RecvBufferSize = 8;
}

I can say this resolved my issue, It's working fine, the test program works for many consecutive hours receiving data.

Of course this is a PoC and this code later will be introduced in a very large system that already uses a TIdHTTP to receive data from another vendor server.

My feeling is that I'm writing a very ugly code doing things this way.

I'd like to know if there's any better approach to do this or even if it's possible to write a class to replace the receive buffer (of course, the goal is no buffering).
Reply


Messages In This Thread
TIdHTTP Lightstreamer Client - by rsiw2000 - 05-03-2019, 11:55 AM
RE: TIdHTTP Lightstreamer Client - by rlebeau - 05-03-2019, 06:37 PM
RE: TIdHTTP Lightstreamer Client - by rsiw2000 - 05-13-2019, 01:50 PM
RE: TIdHTTP Lightstreamer Client - by rlebeau - 05-14-2019, 08:37 AM
RE: TIdHTTP Lightstreamer Client - by rsiw2000 - 05-14-2019, 01:42 PM
RE: TIdHTTP Lightstreamer Client - by rsiw2000 - 05-03-2019, 09:57 PM
RE: TIdHTTP Lightstreamer Client - by rsiw2000 - 05-16-2019, 03:05 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)