InstanceContext.IncomingChannels Eigenschaft

Definition

Ruft die sitzungsbasierten Kanäle ab, die bei der Dienstinstanz eingehen.

public:
 property System::Collections::Generic::ICollection<System::ServiceModel::Channels::IChannel ^> ^ IncomingChannels { System::Collections::Generic::ICollection<System::ServiceModel::Channels::IChannel ^> ^ get(); };
public System.Collections.Generic.ICollection<System.ServiceModel.Channels.IChannel> IncomingChannels { get; }
member this.IncomingChannels : System.Collections.Generic.ICollection<System.ServiceModel.Channels.IChannel>
Public ReadOnly Property IncomingChannels As ICollection(Of IChannel)

Eigenschaftswert

Die ICollection<T> vom Typ IChannel, die sitzungsbasierte Kanäle enthält, die bei der Dienstinstanz eingehen.

Ausnahmen

Die Dienstinstanz wird geschlossen und kann nicht verwendet werden.

Der Dienstinstanz weist einen Fehlerstatus auf.

Beispiele

Im folgenden Code wird gezeigt, wie auf die IncomingChannels-Eigenschaft zugegriffen wird:

OperationContext operationContext = OperationContext.Current;
InstanceContext instanceContext = operationContext.InstanceContext;
ICollection<IChannel> incomingChannels = instanceContext.IncomingChannels;
Uri baseAddress = new Uri("http://localhost:8000/ServiceModelSamples/service");

// Create a ServiceHost for the CalculatorService type and provide the base address.
using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress))
{
    serviceHost.Open();
    OperationContext operationContext = OperationContext.Current;
    InstanceContext instanceContext = operationContext.InstanceContext;
    ICollection<IChannel> channels = instanceContext.IncomingChannels;
}

Gilt für: