Compartir a través de


InstanceContext.IncomingChannels Propiedad

Definición

Obtiene canales con sesión que entran en la instancia del servicio.

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 propiedad

ICollection<IChannel>

ICollection<T> de tipo IChannel que contiene los canales con sesión que entran a la instancia del servicio.

Excepciones

La instancia del servicio se cierra y no se puede utilizar.

La instancia del servicio está en estado de error.

Ejemplos

En el siguiente código se muestra cómo acceder a la propiedad IncomingChannels:

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

Se aplica a