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);
Benny S. Tordrup - 28 Jun 2006 12:34 GMT
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
>I have a simple MarshalByRefObject derived Object (remotableObject) in
> a separate assembly that is referenced by both remoting server and
[quoted text clipped - 23 lines]
> Activator.GetObject(typeof(RemotableObject),
> "tcp://localhost:8080/MyUri", null);
Spam Catcher - 29 Jun 2006 00:49 GMT
> I think you're in the same situation as I am with the thread "Client
> call backs".
[quoted text clipped - 3 lines]
> samples I found about client call backs generates the call backs in
> methods called by the client thus having an open connection.
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.
TT (Tom Tempelaere) - 25 Jul 2006 15:25 GMT
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,

Signature
Tom Tempelaere.
> > I think you're in the same situation as I am with the thread "Client
> > call backs".
[quoted text clipped - 13 lines]
>
> Sample #2 works well.
Spam Catcher - 30 Jul 2006 15:23 GMT
=?Utf-8?B?VFQgKFRvbSBUZW1wZWxhZXJlKQ==?=
<_|\|_0$P@|/\|titi____AThotmailD.Tcom|/\|@P$0_|\|_> wrote in
news:7FDA070F-0A4F-4F31-B711-309BDE834AE1@microsoft.com:
> 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.
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.
> 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.