Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Feb : Re: OnWork does not fire in Indy10 Delphi 2007

www.cryer.info
Managed Newsgroup Archive

Re: OnWork does not fire in Indy10 Delphi 2007

Subject:Re: OnWork does not fire in Indy10 Delphi 2007
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Wed, 13 Feb 2008 10:18:47

"Moore" <moore@hotmail.com> wrote in message
news:47b2c267$1@newsgroups.borland.com...

> i have a cmdtcpclient and a tcpserver, i create a command
> called 'hello' and in its event OnCommand a
> shoemessage('cmd received')

The OnCommand event handler is triggered in the context of a worker thread,
not the main thread.  ShowMessage() is not a thread-safe.  Use
Windows.MessageBox() instead.

> i connect to the tcpserver with the connect method,
>
> in the server i put this in the OnConnect event:
>
> AContext.Connection.SendCmd('greet');

You said that the command you added to the client's CommandHandlers
collection was named 'hello', not 'greet'.  The two must match each other.

> the client hangs in the button click that contains the connect
> method

Please show your actual code.  Connect() should not be hanging by itself, so
you are probably not using it correctly.

> and no message box appears !

Because the server is not sending the command that the client is actually
expecting.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive