« Return to Thread: NotImplementedException during RouteMessage

NotImplementedException during RouteMessage

by Martin Wickman :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View in Thread

Hello

When a client disconnects from the server, that is, when the client closes the browser/tab and the time out eventually occurs, I wanted to broadcast that event to all other clients telling them that this client is not longer there. I implemented this as listening on SessionCreated/SessionDestroyed events. It seemed as straightforward as doing this in the SessionDestroyed handler:

        // In my service constructor:
                ClientManager.AddSessionCreatedListener(this);

        // In my listener class:
        public void SessionCreated(IClient client)
        {
                client.AddSessionDestroyedListener(this);
        }
     
        public void SessionDestroyed(IClient client)
      {
                broadcastStatus(); // Throws exception!
                client.RemoveSessionDestroyedListener(this);
        }

The broadcastStatus() method sends an AsyncMessage to the destination as usual. But the problem is that I get a NotImplementedException from the FluorineFx.Context._TimeoutContext when I call messageBroker.RouteMessage. See stack trace below. The reason is obvious: you cannot send a message to a client that has timed out.

So how can I get around this, i.e. how can I send a message to the other clients that still are connected?

This seems like it could be a race condition and could possibly occur if unlucky.

NotImplementedException "The method or operation is not implemented."
   at FluorineFx.Context._TimeoutContext.RestorePrincipal(ILoginCommand loginCommand)
   at FluorineFx.Messaging.MessageBroker.RouteMessage(IMessage message, IEndpoint endpoint)
   at FluorineFx.Messaging.MessageBroker.RouteMessage(IMessage message)
   at ServiceLibrary.TreeLock.broadcastLockingStatus() in ...
   at ServiceLibrary.TreeService.SessionDestroyed(IClient client) in ...
   at FluorineFx.Messaging.Client.Disconnect(Boolean timeout)
   at FluorineFx.Messaging.Client.Timeout()
   at FluorineFx.Messaging.ClientManager.RemovedCallback(String key, Object value, CacheItemRemovedReason callbackReason)

/Cheers
Martin

_______________________________________________
fluorine mailing list
fluorine@...
http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com

 « Return to Thread: NotImplementedException during RouteMessage