Did anyone use a RemotingPortal over ipc channel when the server lives in another AppDomain in the same process with the client?

Did anyone use a RemotingPortal over ipc channel when the server lives in another AppDomain in the same process with the client?

Old forum URL: forums.lhotka.net/forums/t/8046.aspx


markell posted on Wednesday, November 25, 2009

Dear sirs and ladies.

I would like to speed up the integration tests of my csla based client server application by moving the server into a dedicated AppDomain in the same process with the client.The integration tests employ two AppDomains, both of which should communicate with the same server AppDomain. I think the right way to do so is by using the RemotingProxy over the IPC channel. But I am not sure how to do so.

Did anyone do it already?

Thanks.

RockfordLhotka replied on Wednesday, November 25, 2009

You might look at the AppDomainProxy sample project in the Samples download. It runs the "server side" code in a separate AppDomain and on a separate thread, thus simulating a remote call without the need for anything to actually be remote.

markell replied on Saturday, November 28, 2009

Hi Rocky,
I have examined the code (and even ran it, after fixing a few bugs). But, it has a serious flaw. My unit tests employ two app domains, which speak to the same server. This way I can test simultaneous access from two users to the same server.When the server runs in a separate process, the two unit test app domains are talking to the same server AppDomain, thus they share the same static server data.

When, however, I use the sample proxy, each unit test app domain speaks to a different server instance living in a dedicated app domain - they do not share the same static server data.

The problem exists because the sample proxy creates a server app domain. If another unit test app domain executes the proxy, then a new server app domain is created. The two servers share the same database, but they have different static data, which is not good for me.

Another solution is needed. Any ideas?

Thanks.

P.S.
The solution I see is not  very beautiful. It involves transferring a MarshalByRefObject denoting the server portal between the unit test app domains, so that all of them talk to the same server portal. I just hope there is a better solution.

Copyright (c) Marimer LLC