Export (0) Print
Expand All

IClientChannelSinkProvider Interface

Creates client channel sinks for the client channel through which remoting messages flow.

For a list of all members of this type, see IClientChannelSinkProvider Members.

[Visual Basic]
Public Interface IClientChannelSinkProvider
[C#]
public interface IClientChannelSinkProvider
[C++]
public __gc __interface IClientChannelSinkProvider
[JScript]
public interface IClientChannelSinkProvider

Classes that Implement IClientChannelSinkProvider

Class Description
BinaryClientFormatterSinkProvider Provides the implementation for the binary client formatter sink provider.
SoapClientFormatterSinkProvider Provides the implementation for a client formatter sink provider.

Remarks

Channel sinks are connected to a client channel through implementations of the IClientChannelSinkProvider interface. All the remoting client channels provide constructors that take an IClientChannelSinkProvider as a parameter.

Channel sink providers are stored in a chain, and the user is responsible for chaining all channel sink providers together before passing the outer one to the channel constructor. IClientChannelSinkProvider provides a property called Next for this purpose.

When multiple channel sink providers are specified in a configuration file, the remoting infrastructure will chain them together in the order they are found in the configuration file. The channel sink providers will be created when the channel is created during the RemotingConfiguration.Configure call.

Example

[Visual Basic] 
Public Class MyServerProcessingLogClientChannelSinkProviderData
   Implements IClientChannelSinkProvider

   Private myClientChannelSinkProviderNext As IClientChannelSinkProvider = Nothing

   Public Sub New()
   End Sub 'New

   Public Sub New(ByVal myIDictionaryProperties As IDictionary, ByVal _
              myICollectionProviderData As ICollection)
   End Sub 'New

   Public Function CreateSink(ByVal myChannelSenderData As IChannelSender, ByVal url As String, _
              ByVal myRemoteChannelData As Object) As IClientChannelSink Implements _
              IClientChannelSinkProvider.CreateSink
      Dim myClientChannelSinkNextSink As IClientChannelSink = Nothing
      If Not (myClientChannelSinkProviderNext Is Nothing) Then
         myClientChannelSinkNextSink = myClientChannelSinkProviderNext.CreateSink _
              (myChannelSenderData, url, myRemoteChannelData)
         If myClientChannelSinkNextSink Is Nothing Then
            Return Nothing
         End If
      End If
      Return New MyLoggingClientChannelSink(myClientChannelSinkNextSink)
   End Function 'CreateSink

   Public Property [Next]() As IClientChannelSinkProvider Implements IClientChannelSinkProvider.Next
      Get
         Return myClientChannelSinkProviderNext
      End Get
      Set(ByVal Value As IClientChannelSinkProvider)
         myClientChannelSinkProviderNext = Value
      End Set
   End Property
End Class 'MyServerProcessingLogClientChannelSinkProviderData

[C#] 
public class MyServerProcessingLogClientChannelSinkProviderData : IClientChannelSinkProvider
{

   private IClientChannelSinkProvider myClientChannelSinkProviderNext = null;
   public MyServerProcessingLogClientChannelSinkProviderData()
   {
   }
   public MyServerProcessingLogClientChannelSinkProviderData(IDictionary myIDictionaryProperties,
                                                               ICollection myICollectionProviderData)
   {
   }

   public IClientChannelSink CreateSink(IChannelSender myChannelSenderData, String url,
      Object myRemoteChannelData)
   {
      IClientChannelSink myClientChannelSinkNextSink = null;
      if (myClientChannelSinkProviderNext != null)
      {
         myClientChannelSinkNextSink =
            myClientChannelSinkProviderNext.CreateSink(myChannelSenderData, url, myRemoteChannelData);
         if (myClientChannelSinkNextSink == null)
            return null;
      }
      return new MyLoggingClientChannelSink(myClientChannelSinkNextSink);
   }

   public IClientChannelSinkProvider Next
   {
      get
         {
            return myClientChannelSinkProviderNext;
         }
      set
         {
             myClientChannelSinkProviderNext = value;
         }
   }
}

[C++] 
public __gc class MyServerProcessingLogClientChannelSinkProviderData : public IClientChannelSinkProvider
{

private:
   IClientChannelSinkProvider* myClientChannelSinkProviderNext;
public:
   MyServerProcessingLogClientChannelSinkProviderData()
   {
      myClientChannelSinkProviderNext = 0;
   }

   MyServerProcessingLogClientChannelSinkProviderData(IDictionary* myIDictionaryProperties,
      ICollection* myICollectionProviderData)
   {
   }

   IClientChannelSink* CreateSink(IChannelSender* myChannelSenderData, String* url,
      Object* myRemoteChannelData)
   {
      IClientChannelSink* myClientChannelSinkNextSink = 0;
      if (myClientChannelSinkProviderNext != 0)
      {
         myClientChannelSinkNextSink =
            myClientChannelSinkProviderNext->CreateSink(myChannelSenderData, url, myRemoteChannelData);
         if (myClientChannelSinkNextSink == 0)
            return 0;
      }
      return new MyLoggingClientChannelSink(myClientChannelSinkNextSink);
   }

   __property IClientChannelSinkProvider* get_Next()
   {
      return myClientChannelSinkProviderNext;
   }

   __property void set_Next( IClientChannelSinkProvider* value )
   {
      myClientChannelSinkProviderNext = value;
   }

};

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.Runtime.Remoting.Channels

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Mscorlib (in Mscorlib.dll)

See Also

IClientChannelSinkProvider Members | System.Runtime.Remoting.Channels Namespace

Show:
© 2014 Microsoft