views:

508

answers:

4

In my case, the server will notify the client to fetch his data when the data is ready. This notification is implemented via an event which the client has to subscribe.

When tested in the same computer, the client get notified without any problems. However, when client is moved to the other computer, it cannot get the notifications any more.

I checked the network connection and the availability of remoting service, and found the client can access the remoting object marshalled on the server end, event subscription was fine without any exceptions.

But what confused me is that actually the server's event == null, means client's method never registered here.

Does anybody know the cause? Thanks BR

+1  A: 

First of all, I'd look in the event logs on both the client and the server to see if there are errors related to this.

Second, is it the same user identity with the remote client and with the local client? Same logged in user with the same domain account?

What about firewall setup? Are you sure that Remoting is allowed in?

Finally, just to make sure: are you aware that Remoting is now deprecated in favor of WCF?

John Saunders
- Sure the remoting is allowed.- the software are based upon .net 2.0
cui chun
I said firewall. Is the port open for inbound traffic?
John Saunders
Yes, the firewall blocked the incoming messages. After the firewall removed, the events arrived as expected. Thanks
cui chun
+1  A: 

Each client object that register to server event should be MarshalByRefObject and its assembly should be referenced by the server. So you need wrappers around events if you want to use them in remoting

Perhaps, this article may help you.

http://aviadezra.blogspot.com/2008/06/code-snippets-remoting-client-server_19.html

Bogdan_Ch
Wrapped otherwise it will report building error
cui chun
A: 

If remoting calls are going both directions, ports need to be openable in both directions meaning your server needs to be capable of opening a port on your clients. You'll have two sockets open, bi direction communication.

A: 

If using a wrapper to involve delegate, it cause memory leak on instance of wrapper. i try unregister event by -= operator but these instance never be collected. what should i do?