event IPC remoting proxy channel sink

Posted on 2007-10-08
Last Modified: 2013-12-17
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.

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);

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);

Question by:twinfrey
    LVL 21

    Expert Comment

    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

    Author Comment

    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:  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.
    LVL 21

    Accepted Solution

    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?

    Author Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now