all groups > dotnet remoting > june 2006 >
You're in the

dotnet remoting

group:

remoring an event from server to clients


remoring an event from server to clients Robert Ludig
6/28/2006 12:25:53 AM
dotnet remoting:
I have a simple MarshalByRefObject derived Object (remotableObject) in
a separate assembly that is referenced by both remoting server and
client. Both server and client contain a member of that type.
RemotableObject also contains an event. This event can be fired by the
server AND the client. When the server fires that event the client
should get notfied, when the server fires that event the client should
get notfied. Unfortunately the the latter does not happen. Whenever the
remoting server fires the event the client's eventhandler method never
gets called. (Both client and server added an eventhandler-method for
remotableObject.SomeEvent). What am I doing wrong or what do I need to
do to achieve the desired effect?

On ther server side I marshal that meber like this:

channel = new TcpChannel(8080);
....
ChannelServices.RegisterChannel(channel,false);
RemotingServices.Marshal(remotableObject, "MyUri",
typeof(RemotableObject));

On the client side I activate like this:

channel = new TcpChannel();
ChannelServices.RegisterChannel(channel, false);
remotableObject = (RemotableObject)
Activator.GetObject(typeof(RemotableObject),
"tcp://localhost:8080/MyUri", null);
Re: remoring an event from server to clients Benny S. Tordrup
6/28/2006 1:34:40 PM
Hi,

I think you're in the same situation as I am with the thread "Client call
backs".

I've come to the conclusion that the problem is that an open connection is
not established between the server and the client. All samples I found about
client call backs generates the call backs in methods called by the client
thus having an open connection.

Best regards,

Benny Tordrup

"Robert Ludig" <schwertfischtrombose@gmx.de> skrev i en meddelelse
news:1151479553.277682.247500@j72g2000cwa.googlegroups.com...
[quoted text, click to view]

Re: remoring an event from server to clients Spam Catcher
6/28/2006 11:49:48 PM
"Benny S. Tordrup" <nospam.bt.nospam@fk-data.nospam.dk> wrote in
news:u5EgMbqmGHA.1552@TK2MSFTNGP04.phx.gbl:

[quoted text, click to view]

Yes, you need bidirectional remoting for this to work. Best thing - do not
use events.

Rather have the server "push" events to a client by calling a function on
the client.

http://www.codeproject.com/csharp/RemotingAndEvents.asp

Sample #2 works well.
Re: remoring an event from server to clients TT (Tom Tempelaere)
7/25/2006 7:25:01 AM
Hi,

If the server dies, the client has no way of knowing that it should
reregister its callback instance with the server. I consider that to be a
flaw.

I believe your statement is valid: Don't use events/callbacks over remoting.
Try the pull model instead and see if it is suitable for your problem.

Kind regards,
--
Tom Tempelaere.


[quoted text, click to view]
Re: remoring an event from server to clients Spam Catcher
7/30/2006 2:23:24 PM
=?Utf-8?B?VFQgKFRvbSBUZW1wZWxhZXJlKQ==?=
<_|\|_0$P@|/\|titi____AThotmailD.Tcom|/\|@P$0_|\|_> wrote in
news:7FDA070F-0A4F-4F31-B711-309BDE834AE1@microsoft.com:

[quoted text, click to view]

The server should ping the clients to see which client is alive - the
client can keep track of the pings and re-register should it not receive a
ping in x minutes.

[quoted text, click to view]
AddThis Social Bookmark Button