SendAsync Method
Collapse the table of content
Expand the table of content

AspNetWebSocket.SendAsync Method (ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken)

.NET Framework (current version)
 

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.

Exception Condition
ObjectDisposedException

The AspNetWebSocket object is disposed.

System.InvalidOperationException

The AspNetWebSocket object is in an aborted state.

-or-

Sending operations are unavailable.

.NET Framework
Available since 4.5
Return to top
Show:
© 2016 Microsoft