views:

54

answers:

0

I have written an ActiveX COM Dll, which is used in webpage. It exposes 2 functions say Connect, Disconnect and 2 events. In Connect method, I have created an instance to another class, lauches 2 threads one for Receiving Events and one for HeartBeat(HB). In the Disconnect method, I am disconnecting the Socket, (if connecting Socket is valid) and closing both the threads. In one scenario, say two webpages(both using my Dll) are open, when a webpage calls Disconnect method, it not only closes corresponding Receive and HB threads, but also the other webpages threads. In the Logs I can find the webpages are using different instances of the dll, Thread Id's(obviously), Socket Descriptors.

I am pretty confused about the behaviour. Will the IE reuse the same instance by any chance? Can any one help around this?

Thanks and Regards.