AspNetWebSocket.SendAsync Method

.NET Framework 4.5

Sends a single message fragment to a remote client.

Namespace:  System.Web.WebSockets
Assembly:  System.Web (in System.Web.dll)

public override Task SendAsync(
	ArraySegment<byte> buffer,
	WebSocketMessageType messageType,
	bool endOfMessage,
	CancellationToken cancellationToken
)

Parameters

buffer
Type: System.ArraySegment<Byte>

The array that contains the message data.

messageType
Type: System.Net.WebSockets.WebSocketMessageType

The message type.

endOfMessage
Type: System.Boolean

true to indicate that a fragment is the end of a complete message; otherwise, false.

cancellationToken
Type: System.Threading.CancellationToken

The object that cancels a pending operation.

Return Value

Type: System.Threading.Tasks.Task
A reference to the task of sending a message.

ExceptionCondition
ObjectDisposedException

The AspNetWebSocket object is disposed.

System.InvalidOperationException

The AspNetWebSocket object is in an aborted state.

-or-

Sending operations are unavailable.

.NET Framework

Supported in: 4.6, 4.5
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft