event IPC remoting proxy channel sink

When my event fires, the following exception occurs:
This remoting proxy has no channel sink which means either the server has no registered server channels that are listening, or this application has no suitable client channel to talk to the server.

Client
const string mediatorUrl = "ipc://MediatorChannel/MediatorManager";
IDictionary prop = new Hashtable();
prop["portName"] = "MediatorChannel";
prop["authorizedGroup"] = "Everyone";

BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider(prop, null);
_channel = new IpcClientChannel(prop, clientProvider);

ChannelServices.RegisterChannel(_channel, false);
_serviceManager = (MediatorManager)Activator.GetObject(typeof(MediatorManager), mediatorUrl);

_serviceManager.OrderProcessingStarted += new EventHandler(ProcessingStarted);
_serviceManager.OrderProcessingCompleted += new EventHandler(ProcessingCompleted);

Server
IDictionary prop = new Hashtable();
prop["portName"] = "MediatorChannel";
prop["authorizedGroup"] = "Everyone";

BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider(prop, null);
serverProvider.TypeFilterLevel = TypeFilterLevel.Full;

_channel = new IpcServerChannel(prop, serverProvider);
 ChannelServices.RegisterChannel(_channel, false);

RemotingConfiguration.RegisterWellKnownServiceType(
    typeof(MediatorManager),
    "MediatorManager",
    WellKnownObjectMode.Singleton);
twinfreyAsked:
Who is Participating?
 
surajgupthaConnect With a Mentor Commented:
Singletom just means that there will be just one instance of the server handling multiple requests unlike single call. why do you think the proxy creates a singleton. Did you means that for every proxy call a new singleton gets created at the server?
0
 
surajgupthaCommented:
Are you sure your server is exposing "ipc://MediatorChannel/MediatorManager" ?? If you are using remoting shouldnt the address just be a HTTP or a TCP address? Just thinking out loud
0
 
twinfreyAuthor Commented:
my understanding is no.  ipc does not use http or tcp remoting.  it uses windows messaging.

so, my original problem is actually a few problems. 1)  using a client and server icp channel is not good enough if you want events, as the server needs to know about the client.  so, it is better to use ipc channel and configure client and server formatters when registering channel.  Or add it to config.  2)  the events need to be wrapped in a class that fires the events to the proxy.  I found this solution very helpful:  http://sayala.com/code/RemotingEvents.zip  3)  Now, here is my current problem.  My remote object actually references a singleton on the server.  But, it appears that the proxy is creating its own singleton and thus the data is not updated correctly.  Aside from that, my events and callbacks are successful.
0
 
twinfreyAuthor Commented:
The solution was complicated.  I did a few things.  I added a subscriber pattern with an event sync as shown in the previous link.  I also made an abstract class that did not marshall with all static properties for the server to interact.  The marshalled object subscribed to the static events in the abstract server object and my event syn subscribed to the remote object.  It all works, and now that I understand it better, it all makes sense.  Explaining it here is another thing entirely.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.