HighTechTalks DotNet Forums  

Raise event to client

Dotnet Framework (Remoting) microsoft.public.dotnet.framework.remoting


Discuss Raise event to client in the Dotnet Framework (Remoting) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Le Minh
 
Posts: n/a

Default Raise event to client - 01-05-2007 , 09:18 AM






Hi all.
I need to write a application using .net remoting technology. The problem
here it that, i need to raise event to client. Image, server do some work
and send result to the client when it finished. How can i do it ?
Thanks all!



Reply With Quote
  #2  
Old   
ThunderMusic
 
Posts: n/a

Default Re: Raise event to client - 01-05-2007 , 11:26 AM






Hi,
In order to make events go through remoting, you must open a channel on your
client app (port 0 if you don't have any other channel), make your event
public and the callback method (the method handling the event) public
also... Maybe you will have to change some things in your config file, but
I can't tell for sure.

There are answers to this question all over the net (I already asked it too,
so it should be in the news archives)... try googling for +".net"
+"remoting" +"events" and browse... But what I gave you should give you
a good start.

I hope it helps

ThunderMusic

"Le Minh" <hanami279 (AT) hotmail (DOT) com> wrote

Quote:
Hi all.
I need to write a application using .net remoting technology. The problem
here it that, i need to raise event to client. Image, server do some work
and send result to the client when it finished. How can i do it ?
Thanks all!




Reply With Quote
  #3  
Old   
Goran Sliskovic
 
Posts: n/a

Default Re: Raise event to client - 01-05-2007 , 06:32 PM



Le Minh wrote:
Quote:
Hi all.
I need to write a application using .net remoting technology. The problem
here it that, i need to raise event to client. Image, server do some work
and send result to the client when it finished. How can i do it ?
Thanks all!

There are examples for that on .NET, but take into consideration that
..NET remoting channel is not bi-directional. Meaning, events are not
coming back on the same established connection, but rather client
establishes new connection back to server to send events. This has
serious implications in routed/firewalled/NAT-ed enviroment - often
connection back to server from client side will not be possible. There
are 3rd party imlpementations that offer bi-directional channels
(Gennuine channels for example). I have not used any, so I cannot
gurantee it works.

Easiest way to send events back in remoting (if you still wish to do it)
is to pass a marshal by ref object to server (which mast be
serializable). When server invokes methods on received marshal by ref
object, it will be passed to the client. I'm sure there are examples on
the internet.

Regards,
Goran



Reply With Quote
  #4  
Old   
Le Minh
 
Posts: n/a

Default Re: Raise event to client - 01-05-2007 , 08:20 PM



Quote:
In order to make events go through remoting, you must open a channel on
your client app (port 0 if you don't have any other channel), make your
event public and the callback method (the method handling the event)
public
Hi, i had done something like you. The event raise to client (i already do
it). But when i execute a method (like Console.writeline("Hello from
server") the method run on thread in server process not in client process.
It is'nt extractly what i need.
Regards!




Reply With Quote
  #5  
Old   
ThunderMusic
 
Posts: n/a

Default Re: Raise event to client - 01-09-2007 , 09:23 AM



It's perfectly normal because Console is a static class thus, Writeline is a
static method... so if you run on the server, it will run in the server
process no matter what you do because the client cannot access the memory of
the server... actually, you cannot call static methods from the client for
the exact same reason... I'm trying to find a solution to this exact
problem...

The solution to your problem would be to get the message to the client from
the server and let the client call Console.WriteLine(message);

I hope it helps

ThunderMusic
"Le Minh" <hanami279 (AT) hotmail (DOT) com> wrote

Quote:
In order to make events go through remoting, you must open a channel on
your client app (port 0 if you don't have any other channel), make your
event public and the callback method (the method handling the event)
public

Hi, i had done something like you. The event raise to client (i already do
it). But when i execute a method (like Console.writeline("Hello from
server") the method run on thread in server process not in client
process. It is'nt extractly what i need.
Regards!





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.