Sunny
7/8/2004 5:09:00 PM
Hi, please read inline:
In article <9712e9c6.0407080822.611ca266@posting.google.com>,
gaetan@xeberon.net says...
> Hello
>
> I''m using a Remoting server (Singleton) and i would like to controle
> its destruction.
> Is there a kind of RemotingConfiguration.Disconfigure?
Why you need this? If you just unregister the channels it will be
enough.
> And most important : Is there a way to call a function before
> disconnection?
> I mean, within the Dispatcher remoting thread, i create other threads
> to delegate the jobs that arrives throught Remoting. But, when I close
> the application (for the moment juste a little executable), the thread
> are not destroyed !
Make your threads Background. Set thread.IsBackground = true; just
before you invoke thread.Start().
> I just need a way to call Stop() for each thread
> but i can''t find a way !
Do you need to make some cleanup on thread end, or you just want it to
die?
> Since it''s a singleton, i cannot have a
> pointer (scuse me, a reference) to the Remoting object, to be able to
> call a method that will call all the Stop...
> I tryed with the "destructor", but it is called ONLY if all other
> thread are destroyed, so i can''t use it to destroy them...
>
> Any idea?
>
> And by the way, how can i set a name to the remoting threads (Client
> and Server) without putting it in every function? For the server, i
> put
> Thread.CurrentThread.Name = "jjdjd"
> in the constructor, which is called at the first connexion, but for
> the client, i don''t find any way to do this properly...
If you create your own threads, you can name them. Remoting uses threads
from the thread pool, so I''m not sure what are you after.
Cheers
Sunny