Jay B. Harlow [MVP - Outlook]
10/8/2004 2:42:00 PM
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
>
>