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 

Migrating to Indy10 - TCPServer Synchronize problem

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





PostPosted: Tue Dec 07, 2004 9:09 pm    Post subject: Migrating to Indy10 - TCPServer Synchronize problem Reply with quote



How can I synchronize a procedure AND get a result in TCPServer's Execute
event in Indy 10
(e.g. synchronize a procedure and then check a variable "resultcode" before
continuing communications to the client)


In earlier versions of Indy, I used to do

TIdSyncServerThread = class(TIdPeerThread)
public
UpdateString: string;
resultcode: integer;
errormsg: string;
constructor Create(ACreateSuspended: Boolean = True; const
ADefaultDataPort : Integer = 4219); reintroduce;
destructor Destroy; override;

procedure AddUpdateFromThread;
procedure LogErrorMessage;
end;


IdTCPServer1.ThreadClass := TIdSyncServerThread;

in the execute event I used to have
procedure TdmSyncUpdater.IdTCPServer1Execute(AThread: TIdPeerThread);
begin
.......
(AThread as TIdSyncServerThread).UpdateString := S; // got from a readln
previously
(AThread as TIdSyncServerThread).Synchronize((AThread as
TIdSyncServerThread).AddUpdateFromThread);
AThread.Connection.WriteInteger( (AThread as
TIdSyncServerThread).resultcode );

I could call the procedure and check the "resultcode" variable.
How can I do this in Indy 10? any example please. I do not care if it is
yarn, idnotify, or idsync or postmessage, just something that lets me do
this :)

any help greatly appreciated (please reply to group)

Loki


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.