Redigera

Dela via


IOutputChannel.Send Method

Definition

Sends a message on the current output channel.

Overloads

Send(Message)

Transmits a message to the destination of the output channel.

Send(Message, TimeSpan)

Sends a message on the current output channel within a specified interval of time.

Send(Message)

Source:
IOutputChannel.cs
Source:
IOutputChannel.cs

Transmits a message to the destination of the output channel.

public:
 void Send(System::ServiceModel::Channels::Message ^ message);
public void Send (System.ServiceModel.Channels.Message message);
abstract member Send : System.ServiceModel.Channels.Message -> unit
Public Sub Send (message As Message)

Parameters

message
Message

The Message being sent on the output channel.

Examples

The following code illustrates how to implement this method:

public IAsyncResult BeginTryReceiveRequest(TimeSpan timeout, AsyncCallback callback, object state)
{
    TryReceiveRequestAsyncResult result = new TryReceiveRequestAsyncResult(this, timeout, callback, state);
    result.Begin();
    return result;
}

Remarks

The destination for messages sent out on an output channel is specified at channel creation time.

The Send method does not guarantee the delivery of message to the remote endpoint. An implementation of IOutputChannel can silently drop messages for a variety of reasons. There may be no more buffer room, for example. If delivery guarantees are required, use IOutputSessionChannel.

Passing the message into the output channel causes the message to be consumed. After you call Send, you can no longer inspect the message or call Close on the message.

Applies to

Send(Message, TimeSpan)

Source:
IOutputChannel.cs
Source:
IOutputChannel.cs

Sends a message on the current output channel within a specified interval of time.

public:
 void Send(System::ServiceModel::Channels::Message ^ message, TimeSpan timeout);
public void Send (System.ServiceModel.Channels.Message message, TimeSpan timeout);
abstract member Send : System.ServiceModel.Channels.Message * TimeSpan -> unit
Public Sub Send (message As Message, timeout As TimeSpan)

Parameters

message
Message

The Message being sent on the output channel.

timeout
TimeSpan

The TimeSpan that specifies how long the send operation has to complete before timing out.

Examples

The following code illustrates how to implement this method:

public bool EndTryReceiveRequest(IAsyncResult result, out RequestContext requestContext)
{
    return TryReceiveRequestAsyncResult.End(result, out requestContext);
}

Remarks

The destination for messages sent out on an output channel is specified at channel creation time.

The Send method does not guarantee the delivery of message to the remote endpoint. An implementation of IOutputChannel can silently drop messages for a variety of reasons. There may be no more buffer room, for example. If delivery guarantees are required, use IOutputSessionChannel.

Passing the message into the output channel causes the message to be consumed. After you call Send, you can no longer inspect the message or call Close on the message.

Notes to Implementers

The operation should throw a TimeoutException if the specified timeout is exceeded.

Applies to