BeginSendMessage Method (MessageType, ContentType, Byte[], AsyncCallback, Object)
Sends a message.
Namespace: Microsoft.Rtc.Signaling
Assembly: Microsoft.Rtc.Collaboration (in Microsoft.Rtc.Collaboration.dll)
Syntax
'Declaration
Public Function BeginSendMessage ( _
messageType As MessageType, _
contentType As ContentType, _
body As Byte(), _
userCallback As AsyncCallback, _
state As Object _
) As IAsyncResult
'Usage
Dim instance As SignalingSession
Dim messageType As MessageType
Dim contentType As ContentType
Dim body As Byte()
Dim userCallback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult
returnValue = instance.BeginSendMessage(messageType, _
contentType, body, userCallback, _
state)
public IAsyncResult BeginSendMessage(
MessageType messageType,
ContentType contentType,
byte[] body,
AsyncCallback userCallback,
Object state
)
Parameters
- messageType
Type: Microsoft.Rtc.Signaling..::..MessageType
The type of the message body (message or information).
- contentType
Type: System.Net.Mime..::..ContentType
The content type describing the body. If nullNothingnullptrunita null reference (Nothing in Visual Basic) text/plain, UTF-8 is assumed.
- body
Type: array<System..::..Byte>[]()[][]
The body for the data.
- userCallback
Type: System..::..AsyncCallback
The method to be called when the Send operation has completed.
- state
Type: System..::..Object
The state to be passed back to the callback.
Return Value
Type: System..::..IAsyncResult
An [IAsyncResult] that references this operation.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when arguments are nullNothingnullptrunita null reference (Nothing in Visual Basic). |
ServerPolicyException | A server policy setting does not allow the sending of the message. |
ArgumentException | Thrown when invalid arguments are passed. |
InvalidOperationException | Thrown when the session is in an invalid state to send the message. |
Remarks
The session should be in the Connected state.