Info about thread


(Alessandro) #41

Hi!

Sorry I don t have source code now… I have buyed license but I don t have source code… so there is an callback example?


(marc hoffman) #42

All our licenses come will full library source code, though…


(bachirkallas .) #43

Where Can i download It?


(marc hoffman) #44

It should be part of the regular product install.


(bachirkallas .) #45

I have installed trial before to buy It… So how to upgrade?


(bachirkallas .) #46

Hi…

Ok i have seen this example

But It is client to server call back and It doesn t solve my problem… I Need to have if possibile to have server to client call back… I Need to know if client have received server request… How Can i do?


(bachirkallas .) #47

Ok You write me
if event isn’t delivered, it will be put to queue again.

It s automatically? Or i Need to implement It?
It works Only with Olympia session or Also with Memory session?


(EvgenyK) #48

You need to install full version. you can download it form your personal cabinet ( http://my.remobjects.com )


IROValidatedSessionsChangesListener interface

  IROValidatedSessionsChangesListener = interface
    ['{BE226A1C-DA1A-45E3-9C85-C6C79BAADF5A}']
    procedure EventSucceeded(aClientID, aId: TGUID);
  end;

the EventSucceeded method will be called when event was successfully delivered to client.
aId this is ID of event.
it can be unusable for you because this ID is assigned internally after you have created event


it’s automatically for all events and EventRepositories and you don’t need to implement it
ofc, this is suitable for SuperTCP server only


(bachirkallas .) #49

Ok i have last problem…
Server
My server app send many data to client each 1 second with eventsink
Client
I create ro object in runtime
ROChannel:= TROSuperTCPChannel.create(self);
rochannel.AckWaitTimeout := 20000;
rochannel.ConnectionWaitTimeout := 10000;
rochannel.ConnectTimeout := 10000;
rochannel.Port := SuperTcpPort;
rochannel.Host := SuperTcpHost;
rochannel.SynchronizeEvents := true;
rochannel.OnException := ROChannelException;
rochannel.OnDisconnected := ROChannelDisconnected;
ROMessage:= TROBinMessage.Create;
ROMessage.UseCompression := true;
Romessage.MinSizeForCompression := 256;
Romessage.AddServerExceptionPrefix := false;
RORemoteService:= TRORemoteService.Create(self);
RORemoteService.Channel := RoChannel;
RORemoteService.Message := RoMessage;
RORemoteService.ServiceName := ‘MulticastService’;
EventReceiver:= TROEventReceiver.Create(self);
EventReceiver.Channel := ROChannel;
EventReceiver.Message := RoMessage;
EventReceiver.ServiceName := ‘MulticastService’;
EventReceiver.Interval := 5000;
EventReceiver.MaximumMessagesPerPoll := 5000;
EventReceiver.RegisterEventHandlers([EID_MulticastTestEvent], [Self]);
EventReceiver.Active := True;

And when close app i use
if assigned(EventReceiver) then
begin
// ShutdownServer;
// sleep(2000);
EventReceiver.Active := False;
EventReceiver.UnregisterEventHandlers([EID_MulticastTestEvent]);
end;

if assigned(ROchannel) then
begin
// rochannel.Client.DisconnectNotifyPeer;
ROchannel.Active := false;
if assigned(rochannel) then
if assigned(rochannel.Client) then
if assigned(rochannel.Client.IOHandler) then
begin
rochannel.Client.IOHandler.InputBuffer.Clear;
rochannel.Client.IOHandler.CloseGracefully;
rochannel.Client.Disconnect;
end;
rochannel.DisposeOf;
end;

if assigned(EventReceiver) then
begin
EventReceiver.Active := false;
EventReceiver.free;
EventReceiver:=nil;
end;
if assigned(ROMessage) then
begin

ROMessage.free;
ROMessage:=nil;

end;
if assigned(RORemoteService) then
begin

RORemoteService.free;
RORemoteService:=nil;

end;
inherited Destroy ;

But when close app It gang

It seem that doesn t close threads so how close It?