Click or drag to resize

WebSocketSendAsync Method (Stream, Int32, ActionBoolean)

Sends the data from the specified stream asynchronously using the WebSocket connection.

Namespace:  Sfs2X.WebSocketSharp
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public void SendAsync(
	Stream stream,
	int length,
	Action<bool> completed
)

Parameters

stream
Type: System.IOStream

A Stream instance from which to read the data to send.

The data is sent as the binary data.

length
Type: SystemInt32
An Int32 that specifies the number of bytes to send.
completed
Type: SystemActionBoolean

An Action<bool> delegate or if not needed.

The delegate invokes the method called when the send is complete.

true is passed to the method if the send has done with no error; otherwise, false.

Exceptions
ExceptionCondition
InvalidOperationException The current state of the connection is not Open.
ArgumentNullExceptionstream is .
ArgumentException

stream cannot be read.

-or-

length is less than 1.

-or-

No data could be read from stream.

Remarks
This method does not wait for the send to be complete.
See Also