I have client/Server Application with RoSuper tcp server. Each 0.5 seconds i need to send many datas to client. I have very slow bandwidth from server to client so sometimes server go to in timeout. After Server go in Timeout RoEventRepository doesn t works anymore. Roclient is connected with server but Server doesn t send any data to Client. Server doesn t notify to client that had a problem and i don t know what happen.
I do a small testcase so you can test it.
You need test application in 2 different pc or u need 2 Delphi applications opened.
From one Pc Server Side
Second Pc Client Side
Start Client and Server in Debug mode
Start Server side
Start Client Side and Login
After Login click Button1 in server side. Send Message each 1 second
In Client Insert a breakpoint (I have do BreakPoint button) and wait until Server go in timeout
After Server go in Timeout Press F9 in client so restart after Breakpoint.
Press F9 until Timeout exceptions end
When Server and client run , Client is connected to Server but server doesn t send message anymore.
procedure TSuperTCPChannelChat_ServerMainForm.ROServerClientConnected(
aChannel: IROTransport; const aGuid: TGUID);
begin
if ROSessionManager.IsSessionPresent(aGuid) then
ROEventRepository.AddSession(aGuid,aChannel as IROActiveEventServer,EID_ChatEvents);
end;
we have logged issue (#81334) for resubscribing to active events channels automatically after reconnecting in .NET compatible events mode
So i can t use SuperTcp channel for my project? I must to use http channel? i will use Super http channel? i have read that also Synapse tcp channels have same problems……. Will works with Indy super http channel?
in this specific case (i.e. very slow bandwidth), plain http channel will work more stable in comparing with SuperTCP channel.
try to test your projects with plain http channel
You can use this workaround:
add a new service method like
function TLoginService.IsReconnectNeeded: Boolean;
var
i: integer;
me:TROInMemoryEventRepository;
begin
Result := True;
if IsSessionPresent then begin
me := TROInMemoryEventRepository(EventRepository);
for i := 0 to me.SessionReferenceCount-1 do
if me.SessionReferences[i].SessionID = ClientID then
if me.SessionReferences[i].ActiveEventReference <> nil then begin
result := False;
break;
end;
end;
end;
and call it by timer, say, every 5-10 sec
if method returns True, you have to reconnect to server.
Note: it will work only if TROInMemoryEventRepository is used, as in this testcase.
I have solved problem check if data is sent or not.
Now i have an other big problem. If i connect 4 pc at same server and 1 pc go in timeout also other pcs go in timeout also if i don t have connection problem
So it seem that RoEventRepository use same connection channel so if client have problem all clients have same problem. So is possible to use RoEventRepository with different channels? how?
procedure TSendEvent.Callback(Caller: TROThreadPool; Thread: TThread);
..
if fOwner.fEventRepository <> nil then begin
// if Supports(fOwner.fEventRepository, IROSessionsChangesListener, aref) then
// aref.SessionsChangedNotification(fClientGuid, saRemoveActiveListener, obj);
this should resolve original issue when client should perform reconnect for receiving events
known issue: server will resend events for which client didn’t confirm delivery so client side may receive some duplicated events.
Thank you it seem that works but i same problem when for example i remove lan cable in 1 pc. Other pcs (with cable connected and different ip) disconnect it
Problem Is not autoreconnect because It Do It manually but problem Is.
For example
I got a working client in usa,France and Italy (with differenti id)
If i unplug cable in France
Automatically disconnect client in usa and in Italy.
How i have said before It seem that use only 1 Channel. If i got an error all clients disconnect