Threads created by the use of NetworkStream?

  • Thread starter Thread starter TDC
  • Start date Start date
T

TDC

I'm working on tying in a library that uses a
TcpClient/NetworkStream/BeginRead. When that lib object is started, it
connects and immediately does a BeginRead that stays pending until the
socket is closed some time later.

(As is common, as data is received it is placed in a buffer and then
rolls back into another BeginRead. For the purposes of troubleshooting
I've not initiated any action that would cause data to come in, so as
to exclude that code from testing. So back to the topic.)

When the shutdown routine is called I can see two therads running. One
at "Highest" priority that never seesm to eneter into .NET code and
another "Normal" priority one that enters the BeginRead callback
handler (presumably from the threadpool).

Now the problem. I never see those two threads disappear from the
Threads debug window afterwards. Does anyone have any idea as to what
is going on?

TIA,
Tom
 
TDC said:
I'm working on tying in a library that uses a
TcpClient/NetworkStream/BeginRead. When that lib object is started, it
connects and immediately does a BeginRead that stays pending until the
socket is closed some time later.

(As is common, as data is received it is placed in a buffer and then
rolls back into another BeginRead. For the purposes of troubleshooting
I've not initiated any action that would cause data to come in, so as
to exclude that code from testing. So back to the topic.)

When the shutdown routine is called I can see two therads running. One
at "Highest" priority that never seesm to eneter into .NET code and
another "Normal" priority one that enters the BeginRead callback
handler (presumably from the threadpool).

Now the problem. I never see those two threads disappear from the
Threads debug window afterwards. Does anyone have any idea as to what
is going on?

What exactly is the problem?

-- Barry
 
The threads seem to prevent the hosting ActiveX exe from shutting down.
When the same dll is used with all code references to this one
TcpClient-based library removed then it shuts-down just fine.

Tom

It seems that those threads are
 
Back
Top