Share via


SendMessage Method (MessageType, 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, _
    contentType As ContentType, _
    body As Byte(), _
    signalingHeaders As IEnumerable(Of SignalingHeader) _
) As SipResponseData
'Usage
Dim instance As SignalingSession
Dim messageType As MessageType
Dim contentType As ContentType
Dim body As Byte()
Dim signalingHeaders As IEnumerable(Of SignalingHeader)
Dim returnValue As SipResponseData

returnValue = instance.SendMessage(messageType, _
    contentType, body, signalingHeaders)
public SipResponseData SendMessage(
    MessageType messageType,
    ContentType contentType,
    byte[] body,
    IEnumerable<SignalingHeader> signalingHeaders
)

Parameters

  • 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.

Return Value

Type: Microsoft.Rtc.Signaling..::..SipResponseData
A SipResponseData object containing the response data.

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 the sending of the message.

RealTimeException

Thrown when the server or remote participant returns an error.

The response code in the exception should give more information about the error or encompasses an SIP error or failure cases encountered during sending the message - SIP Transport error, SIP Authentication, and credential-related errors.

ArgumentException

Thrown when invalid arguments are passed.

InvalidOperationException

Thrown when the session is in an invalid state to send a message.

FailureResponseException

Thrown when the server or remote participant returns an error. The SipResponseData in the exception should give additional information.

Remarks

The session should be in the Connected state. This method is not recommended for a UI thread.

See Also

Reference

SignalingSession Class

SignalingSession Members

SendMessage Overload

Microsoft.Rtc.Signaling Namespace