OK previously I asked about WCF but I had to revert to .Net remoting for a reason that's too long to explain here.
Anyway, everything works well except... I' can't figure out how to disconnect from the client side. Specifically, I'm following the pattern where the server/client shares a common interface declaration, and there is no shared DLL. However on the client side, I have a reference to the interface, but since it isn't derived from MarshalByRefObject, I can't figure out how to initiate a clean disconnect from the client side.
On the client, I'm doing this:
var channel = new TcpClientChannel(); var url = "tcp://" + ipAddress.ToString() + ":" + port.ToString() + "/MyService"; ChannelServices.RegisterChannel(channel, false); var remoteApi = (IMyInterface)Activator.GetObject(typeof(IMyInterface), url);
Anyone have an idea?