RealTimeEndpoint.SendMessage Method (MessageType, RealTimeAddress, ContentType, Byte , IEnumerable<SignalingHeader>)
Synchronously sends a message. The session should be in connected state. This method is not recommended for a UI thread.
Namespace: Microsoft.Rtc.Signaling
Assembly: Microsoft.Rtc.Collaboration (in Microsoft.Rtc.Collaboration.dll)
Syntax
'Declaration
Public Function SendMessage ( _
messageType As MessageType, _
sessionTarget As RealTimeAddress, _
contentType As ContentType, _
body As Byte(), _
signalingHeaders As IEnumerable(Of SignalingHeader) _
) As SipResponseData
'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 returnValue As SipResponseData
returnValue = instance.SendMessage(messageType, _
sessionTarget, contentType, body, _
signalingHeaders)
public SipResponseData SendMessage(
MessageType messageType,
RealTimeAddress sessionTarget,
ContentType contentType,
byte[] body,
IEnumerable<SignalingHeader> signalingHeaders
)
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 null text/plain, UTF-8 is assumed.
- body
Type: []
The body for the data.
- signalingHeaders
Type: System.Collections.Generic.IEnumerable<SignalingHeader>
The headers provided for this message. Can be null.
Return Value
Type: Microsoft.Rtc.Signaling.SipResponseData
The response data.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when null is passed for a required argument. The argument name for the required argument is part of the exception message. |
FailureResponseException | Thrown when the server or remote participant returns an error. The response code in the exception should give more information about the error. |
RealTimeException | Thrown when any of the sub operations of this operation failed due to SIP related errors like connection failure, Authentication failure. |