Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / July 2006

Tip: Looking for answers? Try searching our database.

remoring an event from server to clients

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert Ludig - 28 Jun 2006 08:25 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.