🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #4537

Re: TIdIntercept is working ok on Indy10?

#4537
From: Remy Lebeau (TeamB)
Date: Fri, 21 Jan 2005 01:49
36 lines
2459 bytes
"Omar Zelaya" <ozelaya@invdochat.com> wrote in message
news:41f056ca$1@newsgroups.borland.com...

> I have assigned a IOHandlerStack component to my TidTcpClient
> and assigned a IdConnectionIntercept to the IOHandler

Ok so far.

> on the Send and receive event of the interceptconnection component
> i compress the data using a IdCompressor component just about the
> same thing that the TidCompressionIntercept does

Have you considered writing your own Intercept component that implements the
compression internally?  That would be better than using
TIdConnectionIntercept directly.

> i'm doing this because i'm having problem with the TIdCompressorIntercept
> component

What problem are you having exactly?  You need to be more specific.

> when the client call IOHandler->Write, the TIdIOHandler.WriteDirect
> is called and the send method of my IdConnectionIntercept component
> is triggered, on this method i compress the data and set the new size of
> Abuffer and copy the compressed data back to it, after this when the
> TIdIOHandlerStack.WriteDirect method is called ABuffer contains the
> original data not the compressed one i have moved to ABuffer.

Offhand, I see that the Buffer parameter of WriteDirect() is not passed by
reference, so chances are that when TIdIOHandlerStack.WriteDirect() is
calling TIdIOHandler.WriteDirect(), a copy of the Buffer is being passed to
the Intercept rather than the original Buffer directly.


Gambit
Technical Details
Message-ID: <41f05fdd$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41f056ca$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,5a4b55c4cc5c015d
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <41f056ca$1@newsgroups.borland.com>
Subject: Re: TIdIntercept is working ok on Indy10?
Date: Thu, 20 Jan 2005 17:49:53 -0800
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <41f05fdd$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1106272221 68.69.17.41 (20 Jan 2005 17:50:21 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail