[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.remoting

Clients "aware" of one another

Curtis Justus

10/7/2004 5:15:00 AM

Hi,

I am writing a client/server application where I want my clients to be able
to receive messages from other clients. Here is an example: each client
has a list of help desk calls open. If an action is taken against one of
those items on one client, it would send a message to the other clients that
an action has been taken. The clients would take some type of action based
on that message.

I tried to set up a static delegate that would sit within my service. My
clients would attach an event handler via remoting. Clients would send a
message via a remoted object, and the clients would receive one or two
messages, but would then lose the connection to the delegate.

Does anybody have any ideas of other ways I could handle this? I thought of
maybe having a static message queue in my service and my clients could push
items onto that queue. The clients could poll the service every X seconds
to see if there are any updates, but that seems inefficient. Is there a
good way of having the server alert the client when a new message has been
sent from another client? Perhaps I should have a separate messaging
service that only handles messaging requests...

Thanks in advance,
cj


3 Answers

Ken Kolda

10/7/2004 3:21:00 PM

0

I think you were on the right track with the delegate/event model. There are
many examples of this type of architecture on the web -- here's one along
with an article that explains some of the issues with events in a remoting
environment:

Remoting Events Sample
http://staff.develop.com/woodring/dotnet/#Re...

Working With Events Over Remoting:
http://www.dotnetjunkies.com/Tutorial/BFB598D4-0CC8-4392-893D-30252E2...

Good luck -
Ken


"Curtis Justus" <jcj@rurv.vooru.com> wrote in message
news:uTgRkyCrEHA.2904@TK2MSFTNGP15.phx.gbl...
> Hi,
>
> I am writing a client/server application where I want my clients to be
able
> to receive messages from other clients. Here is an example: each client
> has a list of help desk calls open. If an action is taken against one of
> those items on one client, it would send a message to the other clients
that
> an action has been taken. The clients would take some type of action
based
> on that message.
>
> I tried to set up a static delegate that would sit within my service. My
> clients would attach an event handler via remoting. Clients would send a
> message via a remoted object, and the clients would receive one or two
> messages, but would then lose the connection to the delegate.
>
> Does anybody have any ideas of other ways I could handle this? I thought
of
> maybe having a static message queue in my service and my clients could
push
> items onto that queue. The clients could poll the service every X seconds
> to see if there are any updates, but that seems inefficient. Is there a
> good way of having the server alert the client when a new message has been
> sent from another client? Perhaps I should have a separate messaging
> service that only handles messaging requests...
>
> Thanks in advance,
> cj
>
>


Curtis Justus

10/8/2004 3:22:00 AM

0

Ken,

Thanks for the links.

Take care,
cj
"Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in message
news:uSQKcFIrEHA.324@TK2MSFTNGP11.phx.gbl...
> I think you were on the right track with the delegate/event model. There
are
> many examples of this type of architecture on the web -- here's one along
> with an article that explains some of the issues with events in a remoting
> environment:
>
> Remoting Events Sample
> http://staff.develop.com/woodring/dotnet/#Re...
>
> Working With Events Over Remoting:
>
http://www.dotnetjunkies.com/Tutorial/BFB598D4-0CC8-4392-893D-30252E2...
>
> Good luck -
> Ken
>
>
> "Curtis Justus" <jcj@rurv.vooru.com> wrote in message
> news:uTgRkyCrEHA.2904@TK2MSFTNGP15.phx.gbl...
> > Hi,
> >
> > I am writing a client/server application where I want my clients to be
> able
> > to receive messages from other clients. Here is an example: each
client
> > has a list of help desk calls open. If an action is taken against one
of
> > those items on one client, it would send a message to the other clients
> that
> > an action has been taken. The clients would take some type of action
> based
> > on that message.
> >
> > I tried to set up a static delegate that would sit within my service.
My
> > clients would attach an event handler via remoting. Clients would send
a
> > message via a remoted object, and the clients would receive one or two
> > messages, but would then lose the connection to the delegate.
> >
> > Does anybody have any ideas of other ways I could handle this? I
thought
> of
> > maybe having a static message queue in my service and my clients could
> push
> > items onto that queue. The clients could poll the service every X
seconds
> > to see if there are any updates, but that seems inefficient. Is there a
> > good way of having the server alert the client when a new message has
been
> > sent from another client? Perhaps I should have a separate messaging
> > service that only handles messaging requests...
> >
> > Thanks in advance,
> > cj
> >
> >
>
>


Jay B. Harlow [MVP - Outlook]

10/8/2004 2:42:00 PM

0

Curtis,
Matthew MacDonald's book "Microsoft Visual Basic .NET Programmer's Cookbook"
from MS Press has a topic that shows how to create a simply chat like client
using remoting.

He creates a server side Singleton that maintains the list of clients, when
a client asks the server to broadcast a message, the server iterates the
list of clients, calling a method.

Both the server & client are remotable objects, the server object exists on
the server, while the client objects exist on the clients.

Hope this helps
Jay


"Curtis Justus" <jcj@rurv.vooru.com> wrote in message
news:uTgRkyCrEHA.2904@TK2MSFTNGP15.phx.gbl...
> Hi,
>
> I am writing a client/server application where I want my clients to be
> able
> to receive messages from other clients. Here is an example: each client
> has a list of help desk calls open. If an action is taken against one of
> those items on one client, it would send a message to the other clients
> that
> an action has been taken. The clients would take some type of action
> based
> on that message.
>
> I tried to set up a static delegate that would sit within my service. My
> clients would attach an event handler via remoting. Clients would send a
> message via a remoted object, and the clients would receive one or two
> messages, but would then lose the connection to the delegate.
>
> Does anybody have any ideas of other ways I could handle this? I thought
> of
> maybe having a static message queue in my service and my clients could
> push
> items onto that queue. The clients could poll the service every X seconds
> to see if there are any updates, but that seems inefficient. Is there a
> good way of having the server alert the client when a new message has been
> sent from another client? Perhaps I should have a separate messaging
> service that only handles messaging requests...
>
> Thanks in advance,
> cj
>
>