Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 May : Re: IRC Component and Indy 9

www.cryer.info
Managed Newsgroup Archive

Re: IRC Component and Indy 9

Subject:Re: IRC Component and Indy 9
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Sat, 20 May 2006 03:33:29

"Danila Vershinin" <profyprepATyandexDOTru> wrote in message
news:446ed494$1@newsgroups.borland.com...

> I've attached Delphi 7 project's source files (using Indy 10.0.52)
> in public.attachments.

That latest snapshot version of Indy 10 is 10.1.5.  You should consider
upgrading to the absolute latest codebase.

> Removed OnRaw event handler.When I am on the channel from my
> irc client I can see that the app connects and joins the channel. But I
> can not make it show any server notices sent to it, nor be notified when
> someone joins channel.

Did you verify with a packet sniffer that data is being sent from the server
to begin with?

> procedure TForm1.ircJoin(ASender: TIdContext; ANickname, AHost,
>   AChannel: String);
> begin
> Memo1.Lines.Add('Someone joined channel');
> end;
>
> procedure TForm1.ircPrivateMessage(ASender: TIdContext;
>   const ANicknameFrom, AHost, ANicknameTo, AMessage: String);
> begin
> ShowMessage(AMessage);
> end;

Your code is still not thread-safe.  *ALL* of the event handlers that have
an AContext parameter are run in a separate worker thread.  You cannot
safely access GUI components or forms from outside of the context of the
main thread.  You must synchronize access, or else your code has undefined
behavior.

> I can not find that property

    TIdIOHandlerStream = class(TIdIOHandler)
        //...
    public
        //...
        constructor Create(AOwner: TIdNativeComponent; AReceiveStream:
TIdStream; ASendStream: TIdStream = nil); reintroduce; overload; virtual;
        //...
        property ReceiveStream: TIdStream read GetReceiveStream;
        property SendStream: TIdStream read GetSendStream;
        //...
    end;

In any case, like I said earlier, TIdIOHandlerStream is the wrong class to
use for this situation in the first place.

> neither for TIdIRC not for TIdIOHandlerStack...

You said that you tried to use a TIdIOHandlerStream, and I told you that
ReceiveStream is a property of that class.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive