InstanceContext.IncomingChannels Eigenschap

Definitie

Hiermee haalt u de sessieful kanalen op die binnenkomen bij het service-exemplaar.

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)

Waarde van eigenschap

Het ICollection<T> type IChannel dat de sessieful kanalen bevat die binnenkomen bij het service-exemplaar.

Uitzonderingen

Het service-exemplaar is gesloten en kan niet worden gebruikt.

Het service-exemplaar heeft een foutieve status.

Voorbeelden

De volgende code illustreert hoe u toegang krijgen tot de IncomingChannels eigenschap:

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

Van toepassing op