NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Remoting Channel Reference

ChannelServices Reference

ChannelServices provides for Channel registration, resolution, URL parsing and message sink creation. Activator.GetObject, RemotingServices.Unmarshal and RemotingServices.Connect utilize ChannelServices in resolving an object URL to setup client side infrastructure such as a proxy. The object URL passed to the registered channels to find a channel that can return a message. The message sink is used to deliver messages to the channel.

public class ChannelServices
{
  public static IMessageCtrl AsyncDispatchMessage(
                        IMessage msg, 
                        IMessageSink replySink);
  public static IChannel GetChannel (String name);
  public static IDictionary GetChannelSinkProperties(Object obj)
  public static String[] GetURLsforObject(MarshalByRefObject obj);
  public static void RegisterChannel (IChannel channel);
  public static IChannel[] RegisteredChannels {get;}
  public static IMessageSink ResolveChannelMessageSink(Object obj);
  public static void StartListening (String name, Object data);
  public static void StopListening (String name, Object data);
  public static IMessage SyncDispatchMessage(IMessage msg);
  public static void UnregisterChannel (IChannel channel);
};

AsyncDispatchMessage

This method is used by the channel to dispatch the incoming messages to the server-side chain(s) based on the URI embedded in the message. The URI uniquely identifies the receiving object.

GetChannel

Perform a lookup using the channel name on the registered channels. Returns the channel.

GetChannelSinkProperties

Get the message sink dictionary of properties for a given proxy.

GetURLsforObject

Return an array of all the URLs for an object.

RegisterChannel

Registers a channel. Takes in the IChannel interface from a Channel object.

Throws ArgumentNullException if channel parameter is null.

Throws RemotingException if channel already registered.

RegisteredChannels

Returns an array of the currently registered channels.

ResolveChannelMessageSink

Find the channel message sink associated with a given proxy.

StartListening

Instructs a particular channel to start listening for requests. The data object can be used to pass specific initialization state to the channel.

StopListening

Instruct a particular channel to stop listening for requests. The data object can be used to pass specific initialization state to the channel.

SyncDispatchMessage

This method is used by the channel to dispatch the incoming messages to the server-side chain(s) based on the URI embedded in the message. The URI uniquely identifies the receiving object.

UnregisterChannel

Unregister a paricular channel from the registered channels list.

Throws ArgumentNullException if channel parameter is null.

Throws RemotingException if channel is not registered.

IChannel Reference

public interface IChannel
{
  public int ChannelPriority {get; }
  public String ChannelName  {get; }
  public String MimeType     {get; set; }
}

ChannelName

Returns the name of the channel.

ChannelPriority

This read-only property returns the priority of the channel.

MimeType

This read-write property sets or returns the mime type of the channel.

IChannelSender Reference

The sending side of channels must expose the IChannelSender interface.

public interface IChannelSender : IChannel
{
  IMessageSink CreateMessageSink(
                                  String url, 
                                  Object data, 
                                  out String objectURI);
}

CreateMessageSink

The Channel returns a channel message sink, that delivers messages to the specified URL or channel data object. The completed String URL or the Object state can be NULL. Both cannot be NULL.

A message Sink is returned. Consumes the channel specific portion of the URI and returns the rest of the URI. The channel must return an objectURI. If objectURI is null the complete url is used for the objectURI.

IChannelReceiver Reference

The receiving side of channels must expose the IChannelReceiver interface.

public interface IChannelReceiver : IChannel
{
  public Object ChannelData {get; }
  public String[] GetURLsforURI(String objectURI);
  public void StartListening(Object data);
  public void StopListening(Object data);
}

ChannelData

This read-only property returns the channel specific data. Used when Marshal is called and an ObjRef is created.

GetURLsforURI

Return an array of all the URLs for a URI. Called by ChannelServices. GetURLsforObject.

StartListening

Instruct a particular channel to start listening for requests. The data object can be used to pass specific initialization state to the channel.

StopListerning

Instruct a particular channel to stop listening for requests. The data object can be used to pass specific state to the channel.