See comments inline below...
> I need to be able to set both the port and typeFilterLevel for my remoting
> object. Here's my IDictionary code:
[quoted text clipped - 4 lines]
> BinaryServerFormatterSinkProvider formatterProvider = new
> BinaryServerFormatterSinkProvier( props, null ) ;
That's not quite right -- the port is a property of the channel, not of the
formatter sink. The code should look like:
BinaryServerFormatterSinkProvider formatterProvider = new
BinaryServerFormatterSinkProvider() ;
formatterProvider.TypeFilterLevel = TypeFilterLevel.Full;
IDictionary props = new Hashtable() ;
props["port"] = nTcpPort ;
TcpChannel chan = new TcpChannel(props, null, formatterProvider);
> That's what the articles I read said to do to avoid that annoying security
> exception. I want to know create a TcpChannel object that then provides this
> object using RemotingServices.Marshal(), so I can then use
> RemotingServices.Disconnect() when the time comes to stop the remote object.
> I also need to make sure the object is in Singleton mode.
When you use RemotingServices.Marhshal(), you are effectively creating a
Singleton. The only way to create a SingleCall SAO is via a config file or
using RemotingConfiguration.RegisterWellKnownServerObject().
> The books I have don't really cover any of this. I'm sure there's something
> on the client side I'm going to have to pay attention ( especially if I want
> bidirectional communication between the server and the client ). Anyone have
> a good resource on how to do this all programmatically?
You're on the right track. Just register your channel in the exact same way
on the client but use 0 for the port number. Then, to fetch your singletons,
use Activator.GetObject(). Just be aware that if you're going to be calling
RemotingServices.Disconnect() on the object within the server that any
client code that attempts to access the object from that point on will fail,
so make sure the necessary exception handling is present.
Ken