« Return to Thread: NotImplementedException during RouteMessage

Re: NotImplementedException during RouteMessage

by Martin Wickman :: Rate this Message:

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

Thanks,

So the solution would be to get a newer version (I'm running v1.0.0.15). Hmm... when is a the new release due? I could not find anything fresher than v1.0.0.15 on the FluorineFx site.

Regarding this, it seems that my SessionCreated()/SessionDestroyed() is called three times for a single client. Is that one time for each RemoteObject/Consumer/Producer the client is using? It seems to match at least.

Anyway, what I really want is to be notified when a client (that is, the FlexClient/swf-file) is timed out, most probably due to user closing the browser. You mention something about listening for IClient and IMessageClient destroyed events. I could not find anything in the code about that. Could you guys give me a pointer here, if possible?

/Thanks!
 
-----Original Message-----
From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Support
Sent: den 21 april 2009 00:14
To: 'Fluorine Mailing List'
Subject: Re: [Fluorine] NotImplementedException during RouteMessage

Hi Martin,

In the old version you can delete the exception from _TimeoutContext (it
should work as long the destination you are using to push does not define
security constraints)

"The reason is obvious: you cannot send a message to a client that has timed
out" -> Actually you are not doing that. You are broadcasting (pushing) a
message back to the clients and even if the current client is disconnecting
you must be able to do that (so the exception is a bug)

In the new version this was moved out from the context classes.
However if you have -secured- destinations a security error may still happen
depending which object's time out are you listening for:
- in the case of IClient destroyed event you would need per client
authentication configured (so when the client times out FluorineFx can
restore the correct security context)
- in the case of ISession destroyed event you would need per session
authentication configured (so when the session times out FluorineFx can
restore the correct security context)
- in the case of IMessageClient destroyed event both configurations should
work (you possibly do not need to listen for MessageClient events)
This is because when the time out happens on a server thread that thread
does not have configured any security context (it was started by the ASP.NET
runtime without any client request)
Then your code routes a new message through the Message Broker, and the
broker will try to perform security checks (if applicable)

Zoli

-----Original Message-----
From: fluorine-bounces@...
[mailto:fluorine-bounces@...] On Behalf Of Martin
Wickman
Sent: Sunday, April 19, 2009 5:27 PM
To: fluorine@...
Subject: [Fluorine] NotImplementedException during RouteMessage

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.thesil
entgroup.com


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

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

 « Return to Thread: NotImplementedException during RouteMessage