Android session timeout

I am using .NET custom DA server with custom remoting sdk methods in addition into DataService class, remoting sdk methods will use DA login.

On Android native client, an user do a first login and view some datatable from server with DA.
Session timeout in Server is set to 20 minutes.
When a timeout occours in android client, i have implemented onLoginNeeded method as documentation for automatically reconnect and it works well.

When timeout occours in client when calling semoting sdk method, onloginneeded is not called.
There is some way to do the same as DA?

Could you create a testcase for this issue?

Thanks in advance

This is client/server NET solution: WinFormsApplication37_RemobjectTalkSessionTimeout.zip (4.3 MB)

This is android app: RemObjectsSessionTestCase.zip - Google Drive

The server is simple project with added:

  • Program.cs
    server.NetworkServer.SessionManager.Timeout = 1;
  • DataService.cs

    [RemObjects.SDK.Server.ServiceMethod]
    public DateTime GetUtcNow()
    {
    return DateTime.UtcNow;
    }

Net Client has a working test case to understand what i want to do with android.

Android project is async, so the testcase is reproduced manually.
On android, when session go in timeout, DataAbstract connection will relogin, but calling remoting sdk method will not reconnect.

Hello

Thanks for the testcase.

You did set the ‘relogin needed’ event handler on the data adapter level. When you do call the SDK method you work on the connection channel level and data adapter is not involved. So when the ‘relogin needed’ event is raised there is no handler defined for it.

Adding such handler should rresolve the issue. Sample code:

    channelInstance.setChannelCallback(new ClientChannel.IClientChannelCallback() {
        
        @Override
        public boolean clientChannelNeedsLogin(Exception excptn) {
			// TODO Provide here your own login code
            return fDataModule.getDataAdapter().login("123", "123");
        }
        
        // Alternative Login method for connecting to Relativity instance
        ///            @Override
        ///            public boolean clientChannelNeedsLogin(Exception excptn) {
        ///                String RelativityConnectionStringTemplate = "User Id=\"%s\";Password=\"%s\";Domain=\"%s\";Schema=\"%s\"";
        ///                String lLoginString = String.format(RelativityConnectionStringTemplate, 
        ///                        "simple", "simple", "DASamples", "Simple");
        ///                return fDataModule.getDataAdapter().login(lLoginString);
        ///            }
        
        @Override
        public void requestFailWithException(Exception excptn) {
            // TODO Log exception
        }
    });

Regards

I have added this handler, but it give me this exception:

 java.net.ProtocolException: cannot write request body after response has been read
                                                                                      at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:267)
                                                                                      at com.remobjects.sdk.HttpClientWorker.Dispatch()
                                                                                      at com.remobjects.sdk.HttpClientAsyncWorker.internalDispatch()
                                                                                      at com.remobjects.sdk.AsyncRequest.run()

Thanks, logged as bugs://79029

bugs://79029 got closed with status fixed.

Thanks for the testcase. The issue has been reproduced and fixed. The fix will be available in the next Beta build.