Click or drag to resize

WebSocketSessionManagerSendToAsync Method (Stream, Int32, String, ActionBoolean)

Sends the data from stream asynchronously to the client using the specified session.

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

Parameters

stream
Type: System.IOStream
A Stream instance from which to read the data to send.
length
Type: SystemInt32
An Int32 that specifies the number of bytes to send.
id
Type: SystemString
A String that represents the ID of the session.
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
ArgumentNullException

id is .

-or-

stream is .

ArgumentException

id is an empty string.

-or-

stream cannot be read.

-or-

length is less than 1.

-or-

No data could be read from stream.

InvalidOperationException

The session could not be found.

-or-

The current state of the WebSocket connection is not Open.

Remarks

The data is sent as the binary data.

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

See Also