Sign in to follow this  
Side Winder

C# program not closing properly

Recommended Posts

Hey, my program isn't closing properly after the streams/threads have been started. I'll close it, but it'll still show up in the process manager. What could be causing this? Cheers.

Share this post


Link to post
Share on other sites
Using the sacred power of the I Ching, I've divined that you're closing your program with the function ThisLooksLikeItClosesTheProgramButActuallyDoesnt(). This function looks like it closes the program, but it actually doesn't. Solution: don't use ThisLooksLikeItClosesTheProgramButActuallyDoesnt() to close your program.

Share this post


Link to post
Share on other sites
Using the mystic power of the Tarot, I have divined that your extra threads do not contain message loops, and remain unaffected by Application.Exit(), and thus need to be closed separately before Application.Exit() can function. The Tarot also tells me that you don't have a loop condition that will terminate your threads cleanly, so needs some external force to terminate them such as calling Thread.Abort() on the thread objects.

Share this post


Link to post
Share on other sites
Yeah I was Abort()ing the threads and the problem persisted but after some more looking around it seems my TcpListener was still running! Thanks for the help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this