This documentation is archived and is not being maintained.

IChannelDataStore Interface

Stores channel data for the remoting channels.

Namespace:  System.Runtime.Remoting.Channels
Assembly:  mscorlib (in mscorlib.dll)

[ComVisibleAttribute(true)]
public interface class IChannelDataStore

The IChannelDataStore type exposes the following members.

  NameDescription
Public propertyChannelUrisGets an array of channel URIs to which the current channel maps.
Public propertyItemGets or sets the data object associated with the specified key for the implementing channel.
Top

Channels that want to use the channel sink architecture must implement this interface on their ChannelData object.


#using <System.Runtime.Remoting.dll>
#using <System.dll>

using namespace System;
using namespace System::Runtime::Remoting;
using namespace System::Runtime::Remoting::Channels;
using namespace System::Runtime::Remoting::Channels::Tcp;
using namespace System::Runtime::Remoting::Services;

// Marshal ByRef Object class.
public ref class MyServiceClass: public MarshalByRefObject
{
public:
   String^ HelloWorld()
   {
      return "Hello World";
   }
};

int main()
{
   TcpChannel^ myChannel = gcnew TcpChannel( 8085 );
   ChannelServices::RegisterChannel( myChannel );
   MyServiceClass^ myService = gcnew MyServiceClass;

   // After the channel is registered, register the object
   // with remoting infrastructure by calling Marshal method.
   ObjRef^ myObjRef = RemotingServices::Marshal( myService, "TcpService" );

   // Get the information contributed by active channel.
   IChannelInfo^ myChannelInfo = myObjRef->ChannelInfo;
   IChannelDataStore^ myIChannelData;
   System::Collections::IEnumerator^ myEnum = myChannelInfo->ChannelData->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      Object^ myChannelData = safe_cast<Object^>(myEnum->Current);
      if ( dynamic_cast<IChannelDataStore^>(myChannelData) )
      {
         myIChannelData = dynamic_cast<IChannelDataStore^>(myChannelData);
         System::Collections::IEnumerator^ myEnum1 = myIChannelData->ChannelUris->GetEnumerator();
         while ( myEnum1->MoveNext() )
         {
            String^ myUri = safe_cast<String^>(myEnum1->Current);
            Console::WriteLine( "Channel Uris are -> {0}", myUri );
         }
         String^ myKey = "Key1";
         myIChannelData[ myKey ] = "My Data";
         Console::WriteLine( myIChannelData[ myKey ] );
      }
   }
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: