BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can anyone give a examples to use TIdSync in TidTCPServer`s

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Jorge Woo
Guest





PostPosted: Fri Nov 19, 2004 9:37 am    Post subject: Can anyone give a examples to use TIdSync in TidTCPServer`s Reply with quote



i do not know how to use it.
I should to operate GUI in the Execute Event.

BTW: if i use the TidTCPServer as Server and TTCPClient as Client,
dose I should set the TTCPClient`s ClientType 'ctBlocking'?


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Nov 19, 2004 10:03 am    Post subject: Re: Can anyone give a examples to use TIdSync in TidTCPServe Reply with quote




"Jorge Woo" <hugeant (AT) 126 (DOT) com> wrote


Quote:
i do not know how to use it.
I should to operate GUI in the Execute Event.

TMySync = class(TIdSync)
protected
procedure DoSynchronize; override;
public
constructor Create(AThread: TIdPeerThread); override;
end;

procedure TMySync.DoSynchronize;
begin
// do whatever you need to do with the GUI...
end;

procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
begin
//...
with TMySync.Create(AThread) do try
Synchronize;
finally
Free;
end;
//...
end;

Quote:
BTW: if i use the TidTCPServer as Server and TTCPClient
as Client, dose I should set the TTCPClient`s ClientType
'ctBlocking'?

Makes no difference at all. That only effects the client's own reading and
writing. Doesn't have any effect on the server at all.


Gambit



Back to top
Jorge Woo
Guest





PostPosted: Fri Nov 19, 2004 10:20 am    Post subject: Re: Can anyone give a examples to use TIdSync in TidTCPServe Reply with quote



Thanks for your advice!
another question:
if i should read&Write the main form`s variable,not do
the GUI operate,do i need to use the TIdSync??

There is only one connection to the TidTCPServer.

"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> 写入消息新闻:419dc492$2 (AT) newsgroups (DOT) borland.com...
Quote:

"Jorge Woo" <hugeant (AT) 126 (DOT) com> wrote in message
news:419dbecc (AT) newsgroups (DOT) borland.com...

i do not know how to use it.
I should to operate GUI in the Execute Event.

TMySync = class(TIdSync)
protected
procedure DoSynchronize; override;
public
constructor Create(AThread: TIdPeerThread); override;
end;

procedure TMySync.DoSynchronize;
begin
// do whatever you need to do with the GUI...
end;

procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
begin
//...
with TMySync.Create(AThread) do try
Synchronize;
finally
Free;
end;
//...
end;

BTW: if i use the TidTCPServer as Server and TTCPClient
as Client, dose I should set the TTCPClient`s ClientType
'ctBlocking'?

Makes no difference at all. That only effects the client's own reading
and
writing. Doesn't have any effect on the server at all.


Gambit





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Nov 19, 2004 6:36 pm    Post subject: Re: Can anyone give a examples to use TIdSync in TidTCPServe Reply with quote


"Jorge Woo" <hugeant (AT) 126 (DOT) com> wrote


Quote:
if i should read&Write the main form`s variable,not do
the GUI operate,do i need to use the TIdSync??

It depends on how the rest of your code is using that variable. Please show
an example.

Quote:
There is only one connection to the TidTCPServer.

It does not matter if you have 1 connection or 1000. You still must
synchronize access to the GUI.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.