InstanceContext.IncomingChannels Propriedade

Definição

Recebe os canais de sessão que estão a chegar à instância do serviço.

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)

Valor de Propriedade

O ICollection<T> tipo IChannel of que contém os canais de sessão que entram na instância do serviço.

Exceções

A instância de serviço está fechada e não pode ser utilizada.

A instância de serviço está num estado com defeito.

Exemplos

O código seguinte ilustra como aceder à IncomingChannels propriedade:

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

Aplica-se a