I'm getting this error when I try to register a Callback after a connection/session loss.
I still didn't figure out exactly when it happens, if it is after after connection loss, after the server kills the session or something like it, I tried to force it in several ways but was not able to isolate exactly when it happens.
Debugging the Datasnap code, I noticed that it is raised because of a security token.
My "guess" is that this happens this way:
Anyway, I get this after the client gets a connection error and I try to register the Callback again.
My client code looks like this:
CallbackChannelManager.CloseClientChannel; // Do I need to call this?
CallbackChannelManager.RegisterCallback(TDSTunnelSession.GenerateSessionId, TMyCallback.Create);
The Datasnap documentation about callbacks is so poor that I'm not even start with that, but, my questions are:
Thanks.
The problem was caused because I was using the same CallbackChannelManager.ManagerId to re-register the callback.
I started generating a new ManagerId before re-registering the callback and the error stopped, so now my code looks like:
CallbackChannelManager.CloseClientChannel;
CallbackChannelManager.ManagerId := TDSTunnelSession.GenerateSessionId;
CallbackChannelManager.RegisterCallback(TDSTunnelSession.GenerateSessionId, TMyCallback.Create);