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.

C#
public void Send(System.ServiceModel.Channels.Message message);

Parameters

message
Message

The Message being sent on the output channel.

Examples

The following code illustrates how to implement this method:

C#
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

.NET 10 (package-provided) and other versions
Product Versions
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
UWP 10.0

Send(Message, TimeSpan)

Source:
IOutputChannel.cs
Source:
IOutputChannel.cs

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

C#
public void Send(System.ServiceModel.Channels.Message message, TimeSpan timeout);

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:

C#
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

.NET 10 (package-provided) and other versions
Product Versions
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
UWP 10.0