SendMessage Method (MessageType, RealTimeAddress, ContentType, Byte[])
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() _
) As SipResponseData
'Usage
Dim instance As RealTimeEndpoint
Dim messageType As MessageType
Dim sessionTarget As RealTimeAddress
Dim contentType As ContentType
Dim body As Byte()
Dim returnValue As SipResponseData
returnValue = instance.SendMessage(messageType, _
sessionTarget, contentType, body)
public SipResponseData SendMessage(
MessageType messageType,
RealTimeAddress sessionTarget,
ContentType contentType,
byte[] body
)
Parameters
- messageType
Type: Microsoft.Rtc.Signaling..::..MessageType
The message type.
- sessionTarget
Type: Microsoft.Rtc.Signaling..::..RealTimeAddress
The [URI] of 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.
Return Value
Type: Microsoft.Rtc.Signaling..::..SipResponseData
The response data.
Exceptions
Exception | Condition |
---|---|
ObjectDisposedException | Thrown when the session object is disposed. |
ArgumentNullException | Thrown when 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 endpoint should be in the Connected state. This method is not recommended for a UI thread.