Hi,
In my application, i am using Win Forms and CSLA 3.0. The client machines connect to the app server using WCF over https. Now, i have a requirement for implementing the maintenance window activity. At any point of time, the administrator of the application needs to send a message stating "Please save your work. The system will log you out after 15 minutes." to all of the clients connected in the application. After which all of the clients connected at that point of time will be logged off the system.
The cleint machines may not be in the physical network while connecting to the server as some of the users will be accessing the application from home over the internet. Please suggest the best way of implementing it.
First, the data portal won't help you here, because this sort of scenario is entirely outside its scope. This means you'll need to create your own messaging model outside the context of the data portal.
Second, doing actual callbacks turns out to be very hard - nearly impossible. There are numerous technical reasons for this, and solving them requires very low-level programming to deal with the various NAT/router/firewall products in use today.
Third, fortunately there are a couple realistic options provided by Microsoft.
One is to use the dual http channel provided with WCF, which is a bi-directional channel that is client-initiated (and so avoids the networking complexities I mentioned above). I'd look at this first.
Another is the Windows Azure platform, which might be cost-prohibitive, but includes a message bus technology that does work through nearly any NAT/router/firewall.
Yet another is to write your own http polling component. The Silverlight WCF dual http channel uses a very efficient http polling model, and you could construct yours by using theirs as a conceptual model. I suspect, however, that you are better off using the existing dual http channel with WCF.
RockfordLhotka:Yet another is to write your own http polling component. The Silverlight WCF dual http channel uses a very efficient http polling model, and you could construct yours by using theirs as a conceptual model. I suspect, however, that you are better off using the existing dual http channel with WCF.
I’d love to see whatever sample you come up with :)
Seriously – I’ve been talking about the basic
capability of a WCF feature, not a specific implementation.
I don’t think the dual http channel would work with the
data portal. The data portal is designed around a connectionless model. But maybe
I’m wrong and it would work – but it isn’t something I’ve
tried.
But doing this yourself (with the normal wsHttpBinding or
basicHttpBinding) should be possible. Certainly you could write a ROB object that
blocked on the server for 30 seconds – that’s easy. The hard part
is interrupting that 30 second wait when outbound data arrives – that’d
require some server infrastructure around an outbound message queue on a
per-client basis.
That’d be fun to write, and I’d be tempted if I wasn’t
in the middle of implementing some MVVM support (though the deeper I get into
MVVM the more I’m convinced it isn’t the right direction).
You'll love me latest reply then :-).
I'm sure you could do it with a looping set of commands and a
progressId as part of the command. Kick of the command, then kick off a loop
of GetProgressCommands that query a static dictionary on the server for
updates. Same idea.
On the MVVM front I'd love to hear your running commentary
(especially after our last email thread).
From: Rockford Lhotka [mailto:cslanet@lhotka.net]
Sent: July-30-09 3:55 PM
To: jaddington@alexandergracie.com
Subject: RE: [CSLA .NET] RE: Client callbacks over the internet
I’d love to see whatever sample you come up with :)
Seriously – I’ve been talking about the basic capability of a
WCF feature, not a specific implementation.
I don’t think the dual http channel would work with the data
portal. The data portal is designed around a connectionless model. But maybe
I’m wrong and it would work – but it isn’t something I’ve tried.
But doing this yourself (with the normal wsHttpBinding or
basicHttpBinding) should be possible. Certainly you could write a ROB object
that blocked on the server for 30 seconds – that’s easy. The hard part is
interrupting that 30 second wait when outbound data arrives – that’d require
some server infrastructure around an outbound message queue on a per-client basis.
That’d be fun to write, and I’d be tempted if I wasn’t in the
middle of implementing some MVVM support (though the deeper I get into MVVM the
more I’m convinced it isn’t the right direction).
Copyright (c) Marimer LLC