SignalingSession.SendMessage Method (MessageType, ContentType, Byte )
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() _
) As SipResponseData
'Usage
Dim instance As SignalingSession
Dim messageType As MessageType
Dim contentType As ContentType
Dim body As Byte()
Dim returnValue As SipResponseData
returnValue = instance.SendMessage(messageType, _
contentType, body)
public SipResponseData SendMessage(
MessageType messageType,
ContentType contentType,
byte[] body
)
Parameters
- messageType
Type: Microsoft.Rtc.Signaling.MessageType
Type of the body (message or info).
- contentType
Type: System.Net.Mime.ContentType
Content type describing the body. If null text/plain, UTF-8 is assumed.
- body
Type: []
Body for the data.
Return Value
Type: Microsoft.Rtc.Signaling.SipResponseData
Returns the response data.
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | Thrown when the session is an invalid state to send 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. |