Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 May : Can I call a procedure from OnExecute?
| Subject: | Can I call a procedure from OnExecute? |
| Posted by: | "PeaShooter_OMO" (jacquesv..@homemail.co.za) |
| Date: | Thu, 11 May 2006 01:00:14 |
Can I call a procedure directly from OnExecute and will that procedure be
incorporated into
the thread that the client connection is in or must it be in a Synchronize()
or does it
depend on what is in that procedure (for example using VCL) .
Please consider the following:
----------------------------------------------
type
TForm1 = class(TForm)
IdTCPServer1: TIdTCPServer;
procedure IdTCPServer1Execute(AThread: TIdPeerThread);
private
public
end;
procedure DoBlahBlah;
var
Form1: TForm1;
implementation
procedure DoBlahBlah;
begin
// DO Something Here
end;
procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
var
S : String;
begin
S := AThread.Connection.ReadLn;
If S = 'Blah-Blah' then
DoBlahBlah;
end;
--------------------------------------------
Is this allowed?