[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Elp

6/29/2004 5:58:00 PM

Hi,

I'd like to build a .NET Remoting component that has to be singleton.
Actually, this component will serve as a "collaborative component". Each
client will connect to this component, which will keep a reference to each
connected client. This collaborative component will then be able to send a
message to every or some of the clients, allow clients to see who is
connected, etc...

I'm now wondering if i could host this .NET Remoting component in IIS. This
would allow me to get rid off firewall problems and make security managment
much easier than if i were hosting it in a Windows service. However, it
seems that IIS is not the best place to host a singleton component as it
seems (from what i've read) to destroy the state of the hosted objects from
time to time. So am i stuck hosting it in a windows service? Or is there
some trick that would allow me to do what i want to do while still keeping
IIS as the host?

Thanks


2 Answers

Ken Kolda

6/29/2004 7:29:00 PM

0

Hosting a stateful remoting server under IIS is certainly possible but does
pose more complications than when running as a service. The key is to make
sure ASP.NET doesn''t recycle the AppDomain or worker process in which your
singleton resides. To do this, make sure of the following:

1. You have disabled process recycling. For IIS 5.0, this means updating the
<processModel> section of the machine.config. For IIS 6.0, you set the
properties on the Application Pool in which the web app runs.

2. Make sure no process touches the files in your web app''s directory or in
the Windows\Microsoft.NET\Framework\v1.1.4322\CONFIG folder. Modifying any
of these files can cause your AppDomain to be dumped and restarted. (Be
especially careful if you have a virus scanner as these can trigger the
restart depending on how they touch the files).

If you want something safer at the expense of a bit of performance, you
could host the state in your Windows service and just use IIS to proxy
requests to it via remoting. Then if IIS gets recycled, it doesn''t matter
since the IIS app isn''t stateful.

Ken


"Elp" <rockfamily@REMOVEME.hotmail.com> wrote in message
news:%23TyBGKgXEHA.3396@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> I''d like to build a .NET Remoting component that has to be singleton.
> Actually, this component will serve as a "collaborative component". Each
> client will connect to this component, which will keep a reference to each
> connected client. This collaborative component will then be able to send a
> message to every or some of the clients, allow clients to see who is
> connected, etc...
>
> I''m now wondering if i could host this .NET Remoting component in IIS.
This
> would allow me to get rid off firewall problems and make security
managment
> much easier than if i were hosting it in a Windows service. However, it
> seems that IIS is not the best place to host a singleton component as it
> seems (from what i''ve read) to destroy the state of the hosted objects
from
> time to time. So am i stuck hosting it in a windows service? Or is there
> some trick that would allow me to do what i want to do while still keeping
> IIS as the host?
>
> Thanks
>
>


Allen Anderson

7/6/2004 3:18:00 AM

0

I would leave it as a system service frankly. Singletons and IIS
don''t really mix very well. That''s just from my past experience.

Cheers,
Allen Anderson
http://www.glacialcomp...
mailto: allen@put my website base here.com

On Tue, 29 Jun 2004 18:57:32 +0100, "Elp"
<rockfamily@REMOVEME.hotmail.com> wrote:

>Hi,
>
>I''d like to build a .NET Remoting component that has to be singleton.
>Actually, this component will serve as a "collaborative component". Each
>client will connect to this component, which will keep a reference to each
>connected client. This collaborative component will then be able to send a
>message to every or some of the clients, allow clients to see who is
>connected, etc...
>
>I''m now wondering if i could host this .NET Remoting component in IIS. This
>would allow me to get rid off firewall problems and make security managment
>much easier than if i were hosting it in a Windows service. However, it
>seems that IIS is not the best place to host a singleton component as it
>seems (from what i''ve read) to destroy the state of the hosted objects from
>time to time. So am i stuck hosting it in a windows service? Or is there
>some trick that would allow me to do what i want to do while still keeping
>IIS as the host?
>
>Thanks
>