SignalingSession.SendMessage Method (MessageType, ContentType, Byte , IEnumerable<SignalingHeader>)
Synchronously sends a message. The session should be in the 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, _
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
- messageType
Type: Microsoft.Rtc.Signaling.MessageType
The type of the body (message or info).
- contentType
Type: System.Net.Mime.ContentType
the content type describing the body. Can be null if body is null and if null text/plain, UTF-8 is assumed.
- body
Type: []
the body for the data.
- signalingHeaders
Type: System.Collections.Generic.IEnumerable<SignalingHeader>
A collection of headers provided for this message. Can be null.
Return Value
Type: Microsoft.Rtc.Signaling.SipResponseData
Returns the response data.
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | Thrown when the session is in an invalid state to send a message. |
ArgumentException | Thrown when invalid arguments are passed. |
ArgumentNullException | Thrown when null is supplied for a required argument. The argument name which is required is is part of the exception message. |
FailureResponseException | Thrown when the server or remote participant returns an error. The SipResponseData in the exception should give additional information. |
RealTimeException | Thrown when some other unknown errors occur. |
ServerPolicyException | A server policy setting does not allow the sending of the message. |