sivlniko
August 26th, 2004, 11:48 AM
Hello,
I am developing a ASP.NET Web-Application, and this application shall communicate with an .NET Remoting Server object. On PageLoad the ASP.NET application calls some remote functions on the Remoting Object, wich is an Singelton Server. This functions pretty good ...
The more interesting thing is that I want this Remoting Server Object, to fire Events to all it's clients ( something like an event - broadcaster ), for example those clients could be also ASP.NET Webapplications ...
When a client of the Remoting Server Object runs as a windows console application, the events fired by the remoting server are caught by their eventhandlers on the client-side, without any problems.
In the ASP.NET Application it looks different: while creating and loading the Web-Page, the ASP application starts a new worker thread, which shall live not only for the execution time of a page request. So this thread should remain alive during the whole session ... Within this worker thread's execution, I create the proxy of the Remoting Object and pass an EventHandler function for the incoming Server - Events ... I thought this should be necessary, because the IIS assigns a thread from it's thread-pool to each incoming request, only for the execution - time of the request. After each request processing the worker-thread is detatched again from the application object and at this time my application shall be able to process incoming events from the Remoting Server. There fore I encapsulated the instantiation of the remote object and the assignement of the event-handlers and run them in their own thread.
Unfortunatelly as I have said before, events are caught only in the console application ( client ), but not in the worker thread within my ASP.NET application ...
Does anyone have any Idea why ? Pehaps I have made some conceptual fault ... ???
Thanks in advance
VLAD :confused:
I am developing a ASP.NET Web-Application, and this application shall communicate with an .NET Remoting Server object. On PageLoad the ASP.NET application calls some remote functions on the Remoting Object, wich is an Singelton Server. This functions pretty good ...
The more interesting thing is that I want this Remoting Server Object, to fire Events to all it's clients ( something like an event - broadcaster ), for example those clients could be also ASP.NET Webapplications ...
When a client of the Remoting Server Object runs as a windows console application, the events fired by the remoting server are caught by their eventhandlers on the client-side, without any problems.
In the ASP.NET Application it looks different: while creating and loading the Web-Page, the ASP application starts a new worker thread, which shall live not only for the execution time of a page request. So this thread should remain alive during the whole session ... Within this worker thread's execution, I create the proxy of the Remoting Object and pass an EventHandler function for the incoming Server - Events ... I thought this should be necessary, because the IIS assigns a thread from it's thread-pool to each incoming request, only for the execution - time of the request. After each request processing the worker-thread is detatched again from the application object and at this time my application shall be able to process incoming events from the Remoting Server. There fore I encapsulated the instantiation of the remote object and the assignement of the event-handlers and run them in their own thread.
Unfortunatelly as I have said before, events are caught only in the console application ( client ), but not in the worker thread within my ASP.NET application ...
Does anyone have any Idea why ? Pehaps I have made some conceptual fault ... ???
Thanks in advance
VLAD :confused: