[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.sdk

threads exit without warning

Jim Love

11/18/2002 7:19:00 PM

I have an application that starts up a thread to watch for incoming tcpip. I
have run this over night and it suddenly just exits after a few hours. Any
ideas about what would make the thread exit?

The main loop looks like:

While True
..tcpip code

End While

The thread is fired up by a class I created, the thread is declared in the
class. The way it stops is in the finalize method of the class. There are no
other calls to end the thread in the program. The class is declared public
in a module.

Sub MAin looks like this:
Sub Main(ByVal args() As String)
Startup()''this fires up the thread
Application.Run(g_frmMain)''I use this form right now to shutdown and
diagnostics
g_frmMain.Show()
End Sub




2 Answers

(Xiao Xie [MS])

11/19/2002 4:44:00 PM

0

Hi Jim,

Have you tried adding try/catch in the TCP/IP worker thread? If an
unhandled exception is thrown in that thread, the thread will be aborted.

Sincerely,
Xiao Xie
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Jim Love

11/20/2002 4:55:00 PM

0

I apologize for this post, I have found the 'End' statement that existed
when I ported from windows form application to service.

"Xiao Xie [MS]" <xiaoxie@online.microsoft.com> wrote in message
news:XfheJK#jCHA.2364@cpmsftngxa08...
> Hi Jim,
>
> Have you tried adding try/catch in the TCP/IP worker thread? If an
> unhandled exception is thrown in that thread, the thread will be aborted.
>
> Sincerely,
> Xiao Xie
> Microsoft Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>