BeginSendMessage Method (MessageType, RealTimeAddress, ContentType, Byte[], IEnumerable(SignalingHeader), 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, _
sessionTarget As RealTimeAddress, _
contentType As ContentType, _
body As Byte(), _
signalingHeaders As IEnumerable(Of SignalingHeader), _
userCallback As AsyncCallback, _
state As Object _
) As IAsyncResult
'Usage
Dim instance As RealTimeEndpoint
Dim messageType As MessageType
Dim sessionTarget As RealTimeAddress
Dim contentType As ContentType
Dim body As Byte()
Dim signalingHeaders As IEnumerable(Of SignalingHeader)
Dim userCallback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult
returnValue = instance.BeginSendMessage(messageType, _
sessionTarget, contentType, body, _
signalingHeaders, userCallback, _
state)
public IAsyncResult BeginSendMessage(
MessageType messageType,
RealTimeAddress sessionTarget,
ContentType contentType,
byte[] body,
IEnumerable<SignalingHeader> signalingHeaders,
AsyncCallback userCallback,
Object state
)
Parameters
- messageType
Type: Microsoft.Rtc.Signaling..::..MessageType
The message type.
- sessionTarget
Type: Microsoft.Rtc.Signaling..::..RealTimeAddress
The target to send the message.
- 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.
- signalingHeaders
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'SignalingHeader>)>)>
The headers provided for this invite.
- userCallback
Type: System..::..AsyncCallback
The method to be called when the async operation is completed.
- state
Type: System..::..Object
A user-provided object that distinguishes this particular asynchronous operation from others.
Return Value
Type: System..::..IAsyncResult
Returns an IAsyncResult that references this operation.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when a non-nullNothingnullptrunita null reference (Nothing in Visual Basic) is expected for an argument. The argument name for which a non-nullNothingnullptrunita null reference (Nothing in Visual Basic) is expected is part of the exception message. |
ServerPolicyException | Thrown when a server policy setting does not allow sending the message. |
ArgumentException | Thrown if one of the [SignalingHeader] in the [signalingHeaders] collection have nullNothingnullptrunita null reference (Nothing in Visual Basic) or restricted header. |