Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IInputChannel Interface

Defines the interface that a channel must implement to receive a message.

Namespace:  System.ServiceModel.Channels
Assemblies:   System.ServiceModel (in System.ServiceModel.dll)
  System.ServiceModel.Primitives (in System.ServiceModel.Primitives.dll)

public interface IInputChannel : IChannel, 
	ICommunicationObject

The IInputChannel type exposes the following members.

  NameDescription
Public propertySupported by Portable Class LibraryLocalAddressGets the address on which the input channel receives messages.
Public propertySupported by Portable Class LibraryStateGets the current state of the communication-oriented object. (Inherited from ICommunicationObject.)
Top

  NameDescription
Public methodSupported by Portable Class LibraryAbortCauses a communication object to transition immediately from its current state into the closed state. (Inherited from ICommunicationObject.)
Public methodSupported by Portable Class LibraryBeginClose(AsyncCallback, Object)Begins an asynchronous operation to close a communication object. (Inherited from ICommunicationObject.)
Public methodSupported by Portable Class LibraryBeginClose(TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to close a communication object with a specified timeout. (Inherited from ICommunicationObject.)
Public methodSupported by Portable Class LibraryBeginOpen(AsyncCallback, Object)Begins an asynchronous operation to open a communication object. (Inherited from ICommunicationObject.)
Public methodSupported by Portable Class LibraryBeginOpen(TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to open a communication object within a specified interval of time. (Inherited from ICommunicationObject.)
Public methodSupported by Portable Class LibraryBeginReceive(AsyncCallback, Object)Begins an asynchronous operation to receive a message that has a state object associated with it.
Public methodSupported by Portable Class LibraryBeginReceive(TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to receive a message that has a specified time out and state object associated with it.
Public methodSupported by Portable Class LibraryBeginTryReceiveBegins an asynchronous operation to receive a message that has a specified time out and state object associated with it.
Public methodSupported by Portable Class LibraryBeginWaitForMessageBegins an asynchronous wait-for-a-message-to-arrive operation that has a specified time out and state object associated with it.
Public methodSupported by Portable Class LibraryClose()Causes a communication object to transition from its current state into the closed state. (Inherited from ICommunicationObject.)
Public methodSupported by Portable Class LibraryClose(TimeSpan)Causes a communication object to transition from its current state into the closed state. (Inherited from ICommunicationObject.)
Public methodSupported by Portable Class LibraryEndCloseCompletes an asynchronous operation to close a communication object. (Inherited from ICommunicationObject.)
Public methodSupported by Portable Class LibraryEndOpenCompletes an asynchronous operation to open a communication object. (Inherited from ICommunicationObject.)
Public methodSupported by Portable Class LibraryEndReceiveCompletes an asynchronous operation to receive a message.
Public methodSupported by Portable Class LibraryEndTryReceiveCompletes the specified asynchronous operation to receive a message.
Public methodSupported by Portable Class LibraryEndWaitForMessageCompletes the specified asynchronous wait-for-a-message operation.
Public methodSupported by Portable Class LibraryGetProperty<T>Returns a typed object requested, if present, from the appropriate layer in the channel stack. (Inherited from IChannel.)
Public methodSupported by Portable Class LibraryOpen()Causes a communication object to transition from the created state into the opened state. (Inherited from ICommunicationObject.)
Public methodSupported by Portable Class LibraryOpen(TimeSpan)Causes a communication object to transition from the created state into the opened state within a specified interval of time. (Inherited from ICommunicationObject.)
Public methodSupported by Portable Class LibraryReceive()Returns the message received, if one is available. If a message is not available, blocks for a default interval of time.
Public methodSupported by Portable Class LibraryReceive(TimeSpan)Returns the message received, if one is available. If a message is not available, blocks for a specified interval of time.
Public methodSupported by Portable Class LibraryTryReceiveTries to receive a message within a specified interval of time.
Public methodSupported by Portable Class LibraryWaitForMessageReturns a value that indicates whether a message has arrived within a specified interval of time.
Top

  NameDescription
Public eventSupported by Portable Class LibraryClosedOccurs when the communication object completes its transition from the closing state into the closed state. (Inherited from ICommunicationObject.)
Public eventSupported by Portable Class LibraryClosingOccurs when the communication object first enters the closing state. (Inherited from ICommunicationObject.)
Public eventSupported by Portable Class LibraryFaultedOccurs when the communication object first enters the faulted state. (Inherited from ICommunicationObject.)
Public eventSupported by Portable Class LibraryOpenedOccurs when the communication object completes its transition from the opening state into the opened state. (Inherited from ICommunicationObject.)
Public eventSupported by Portable Class LibraryOpeningOccurs when the communication object first enters the opening state. (Inherited from ICommunicationObject.)
Top

The IInputChannel contract includes synchronous and asynchronous variants of receive, try-to-receive and wait-for-a-message functionality.

The pull model is used typically with an IInputChannel to receive messages: you call Receive (to "pull" a message out of the channel) and then wait for a message to arrive. An alternative usage pattern is to call BeginWaitForMessage(TimeSpan, AsyncCallback, Object) or BeginWaitForMessage(TimeSpan, AsyncCallback, Object), and then call Receive(TimeSpan). This approach is common for transactional usages where you start the transaction between the calls to WaitForMessage(TimeSpan) and Receive.

An IInputChannel is not necessarily bound to a single sender. Other channels and channel interfaces can provide a correlation between particular senders and an IInputChannel, but the base contract makes no such restriction. An implementation can create a new IInputChannel for each message or reuse the same IInputChannel for multiple messages and senders.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
Show:
© 2015 Microsoft