Click here to Skip to main content
15,889,931 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: WCF Pin
Joachim Kerschbaumer6-Feb-08 4:07
Joachim Kerschbaumer6-Feb-08 4:07 
QuestionYour thoughts about .Net Reactor Pin
Jiaan31-Jan-08 8:29
Jiaan31-Jan-08 8:29 
GeneralRe: Your thoughts about .Net Reactor Pin
Mark Churchill1-Feb-08 3:18
Mark Churchill1-Feb-08 3:18 
GeneralRe: Your thoughts about .Net Reactor Pin
Jiaan1-Feb-08 3:30
Jiaan1-Feb-08 3:30 
GeneralRe: Your thoughts about .Net Reactor Pin
Mark Churchill1-Feb-08 3:47
Mark Churchill1-Feb-08 3:47 
GeneralRe: Your thoughts about .Net Reactor Pin
Jiaan1-Feb-08 3:55
Jiaan1-Feb-08 3:55 
GeneralRe: Your thoughts about .Net Reactor Pin
Mark Churchill1-Feb-08 3:56
Mark Churchill1-Feb-08 3:56 
GeneralWCF service question-detect shutdown inside the service Pin
Chris Bardon31-Jan-08 3:05
Chris Bardon31-Jan-08 3:05 
I'm working on a WCF service project that creates a listener thread for TCP messages, and everything appears to work just fine except for shutting down the service. Here's a simple example that illustrates the problem:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,ConcurrencyMode=ConcurrencyMode.Multiple)]
public class Service1 : IService1, IDisposable
{
private void ThreadFn()
{
bool b = true;
while(b)
{
//do something
Thread.Sleep(1000);
}
}
private Thread m_Thread;
public Service1()
{
m_Thread = new Thread(new ThreadStart(this.ThreadFn));
m_Thread.Start();
}

public void Dispose()
{
m_Thread.Abort();
}
~Service1()
{
Dispose();
}
}

As you can see, this is a singleton service that creates a thread when the host starts, and kills the thread when the service is disposed. Unfortunately, there does not seem to be any way to reliably detect when a service is unloaded by the host. I've tried binding to the AppDomain.Unload and AppDomain.HostProcessExit events, however if Visual Studio hosts the service, these events are never fired. I've also tried creating a custom IInstanceProvider, but this only tells me when a method invocation is performed, and even then only when the InstanceContextMode is changed from Single. I want to be able to move the service into different hosting frameworks, so I'd like a solution that is an generic as possible. Does anyone have any suggestions?

Thanks,

Chris
GeneralMSBuild Problem Pin
Mbire30-Jan-08 23:39
Mbire30-Jan-08 23:39 
GeneralRe: MSBuild Problem Pin
Scott Dorman2-Feb-08 3:47
professionalScott Dorman2-Feb-08 3:47 
QuestionSSL Client side certificates are killing me Pin
JoeJoe10130-Jan-08 9:53
JoeJoe10130-Jan-08 9:53 
GeneralRe: SSL Client side certificates are killing me Pin
led mike30-Jan-08 10:48
led mike30-Jan-08 10:48 
QuestionHow to convert a web application fr0m 1.1 to 2.0? Pin
Gandalf_TheWhite30-Jan-08 2:13
professionalGandalf_TheWhite30-Jan-08 2:13 
GeneralRe: How to convert a web application fr0m 1.1 to 2.0? Pin
TJoe30-Jan-08 7:13
TJoe30-Jan-08 7:13 
GeneralSocket Problems Pin
J. Holzer29-Jan-08 22:58
J. Holzer29-Jan-08 22:58 
GeneralRe: Socket Problems Pin
Mark Churchill30-Jan-08 2:07
Mark Churchill30-Jan-08 2:07 
GeneralRe: Socket Problems Pin
J. Holzer30-Jan-08 3:46
J. Holzer30-Jan-08 3:46 
GeneralRe: Socket Problems Pin
led mike30-Jan-08 7:29
led mike30-Jan-08 7:29 
GeneralCOm Callable Assembly Missing From Reference Lists Pin
Brady Kelly29-Jan-08 22:41
Brady Kelly29-Jan-08 22:41 
GeneralRe: COm Callable Assembly Missing From Reference Lists Pin
led mike30-Jan-08 7:33
led mike30-Jan-08 7:33 
GeneralRe: COm Callable Assembly Missing From Reference Lists Pin
Brady Kelly30-Jan-08 7:38
Brady Kelly30-Jan-08 7:38 
GeneralRe: COm Callable Assembly Missing From Reference Lists Pin
led mike30-Jan-08 7:50
led mike30-Jan-08 7:50 
GeneralRe: COm Callable Assembly Missing From Reference Lists Pin
Brady Kelly30-Jan-08 8:26
Brady Kelly30-Jan-08 8:26 
GeneralFTP WEB Request error (550) File unavailable Pin
Sean_B29-Jan-08 5:21
Sean_B29-Jan-08 5:21 
GeneralRe: FTP WEB Request error (550) File unavailable Pin
Mike Dimmick29-Jan-08 6:59
Mike Dimmick29-Jan-08 6:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.