SendMessage Method (MessageType, RealTimeAddress, ContentType, Byte[], IEnumerable(SignalingHeader))
Sends a message synchronously.
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 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.
Return Value
Type: Microsoft.Rtc.Signaling..::..SipResponseData
The response data.
Exceptions
Exception | Condition |
---|---|
ObjectDisposedException | Thrown when the session object is already disposed. |
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. |
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 | Encompasses an SIP error or failure cases encountered during sending the message - SIP Transport error, SIP Authentication, and credential-related errors. |
Remarks
The session should be in the Connected state. This method is not recommended for a UI thread.