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
