[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Server event handling - beware, beginner lurking!

albiro

10/31/2004 8:41:00 PM

Hi all,

I do apologise if some of the following explanations are rather basic,
but I'm unable to express myself in an enormously technical manner.

I've been fiddling with .NET remoting to put in place a small
client/server system, whereby a remotable objects acts as a "midway"
communication class between the server and the clients.

The server itself handles all the work of coordinating the clients,
and the remotable object simply acts as a way for the clients to say
to the server "hi im here, ready!", and for the server to then send
messages back to the client.

The concept I'm struggling with, is that of subscription to the events
of the remotable object. As far as I've managed to understand, the
clients request the remotable object using the Activator.GetObject()
method, and use the remotable object to run some methods, which in
turn trigger events within the remotable object.

Now, the problem comes when I want to make the server subscribe to
these events. The only method I can see of accomplishing this, is to
in effect, make the server a client, and call the remotable object and
keep it locally. This way, it subscribes to the event, just as if it
was a client, as all the work I want the server to do, I want to keep
independent of the clients, so not remotable.

I was wondering if there's any method of getting a server to subscribe
to events for each individual client, so it handles the clients on a
one-by-one basis, rather than filtering client on the remotable object
level, and if so, any pointers to any information on this?

Many thanks,
Alvaro
1 Answer

Sam Santiago

10/31/2004 10:58:00 PM

0

You might want to check out this remoting Chat example for an example of
using events:

http://support.microsoft.com/default.aspx?scid=kb;en...

It also sounds like you might want to look at Client Activated Objects (CAO)
when you say you want each client treated individually. Check out this link
as a start:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconclientactivation.asp?...

and this article might help understand CAOs further:

Implementing Broker with .NET Remoting Using Client-Activated Objects
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpBroker...

Good luck.

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTe...
_______________________________
"Alvaro" <albiro@gmail.com> wrote in message
news:60f692a0.0410311240.652bdcb@posting.google.com...
> Hi all,
>
> I do apologise if some of the following explanations are rather basic,
> but I'm unable to express myself in an enormously technical manner.
>
> I've been fiddling with .NET remoting to put in place a small
> client/server system, whereby a remotable objects acts as a "midway"
> communication class between the server and the clients.
>
> The server itself handles all the work of coordinating the clients,
> and the remotable object simply acts as a way for the clients to say
> to the server "hi im here, ready!", and for the server to then send
> messages back to the client.
>
> The concept I'm struggling with, is that of subscription to the events
> of the remotable object. As far as I've managed to understand, the
> clients request the remotable object using the Activator.GetObject()
> method, and use the remotable object to run some methods, which in
> turn trigger events within the remotable object.
>
> Now, the problem comes when I want to make the server subscribe to
> these events. The only method I can see of accomplishing this, is to
> in effect, make the server a client, and call the remotable object and
> keep it locally. This way, it subscribes to the event, just as if it
> was a client, as all the work I want the server to do, I want to keep
> independent of the clients, so not remotable.
>
> I was wondering if there's any method of getting a server to subscribe
> to events for each individual client, so it handles the clients on a
> one-by-one basis, rather than filtering client on the remotable object
> level, and if so, any pointers to any information on this?
>
> Many thanks,
> Alvaro