 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
David Guest
|
Posted: Tue Dec 07, 2004 9:09 pm Post subject: Migrating to Indy10 - TCPServer Synchronize problem |
|
|
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 |
|
 |
|
|
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
|
|