Ned,

I would check to see if the Server thread associated with a call from the COM 
component is ever fully released.  Does your server code continue running after the 
call to the .NET client?  Even if it does, can you start counting the current threads 
in use on the server using VS ide?  If the number of threads continues to increase, 
they're not being released for some reason.

If the threads aren't being released, it could be to do with maxing out the .NET 
thread pool.

Hope this helps

Mark


-----Original Message-----
From: Ned [mailto:[EMAIL PROTECTED]
Sent: 17 July 2003 17:45
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] COM interop, .NET Remoting, and threading


I'm currently working on a .NET Remoting project with a server and client
application running on seperate machines over a LAN. The server application
includes a connection to a COM interface on the host machine. This COM
interface raises events and the server application uses .NET Remoting to
then call a callback function on the client and notify it of the event, so
in effect I'm using .NET remoting to remote a COM interface instead of
using DCOM.

I've come across some strange behaviour that seems to relate to the
interaction of the COM interface with .NET. As part of the event
notification from the COM interface it calls a method
called 'OnAddMessage'. Within the implementation of this method in the
server application I have it directly calling the client callback
method 'EventTrigger'. So basically the server is bridging the COM
interface calling 'OnAddMessage' and the subsequent calling
of 'EventTrigger' to notify the client.

I have everything working perfectly with the client succesfully being
notified of the events and all of the .NET Remoting infrastructure appears
to be working fine. The problem I run into is that the COM interface is
only able to call the 'OnAddMessage' a fixed number of times before it
freezes up (17 times to be specific). If I remove the call
to 'EventTrigger' from within the 'OnAddMessage' method then it doesn't
freeze up but then my client doesn't receive any notification.

I know this is probably a confusing description of the problem but I can't
think of a simpler way to describe it. The really interesting aspect of
this problem is the fact that it *always* freezes up after 17 times and I'm
wondering if this is revealing the source of the problem.

My thoughts are that a problem with threading may be the source of the
problem. The COM interface creates it's own threads to call 'OnAddMessage'
and I'm thinking that there may be some limit to how many threads it can
call but I don't have any control over this.

Any thoughts anyone (let me know if you need more details).

Ned.
KUKA Roboter GmbH


************************************************************************

This email (including any attachments to it) is confidential, legally 
privileged, subject to copyright and is sent for the personal attention 
of the intended recipient only. If you have received this email in error,
please advise us immediately and delete it. You are notified that 
disclosing, copying, distributing or taking any action in reliance on 
the contents of this information is strictly prohibited.Although we have 
taken reasonable precautions to ensure no viruses are present in this 
email, we cannot accept responsibility for any loss or damage arising 
from the viruses in this email or attachments.We exclude any liability 
for the content of this email, or for the consequences of any actions 
taken on the basis of the information provided in this email or its 
attachments, unless that information is subsequently confirmed in 
writing. If this email contains an offer, that should be considered 
as an invitation to treat.

*************************************************************************


==================================================================

Reply via email to