Synchronously sends a message. The endpoint 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

Visual Basic (Declaration)
Public 
Function 
SendMessage ( _
	
messageType 
As 

MessageType, _
	
sessionTarget 
As 

RealTimeAddress, _
	
contentType 
As 
ContentType, _
	
body 
As 
Byte() _
) 
As 

SipResponseData
C#
public 

SipResponseData 
SendMessage(
	
MessageType

messageType,
	

RealTimeAddress 
sessionTarget,
	
ContentType 
contentType,
	
byte[] 
body
)
Visual C++
public:

SipResponseData^ 
SendMessage(
	
MessageType

messageType, 
	

RealTimeAddress^ 
sessionTarget, 
	
ContentType^ 
contentType, 
	
array<
unsigned char>^ 
body
)
JavaScript
function 
sendMessage(
messageType, 
sessionTarget, 
contentType, 
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: ContentType
The content type describing the body. If null text/plain, UTF-8 is assumed.
body
Type: array< Byte > [] () []
The body for the data.

Return Value

The response data.

Exceptions

Exception Condition
ArgumentNullException Thrown when non-null is expected for an argument. The argument name for which a non-null is expected is part of the exception message.
ObjectDisposedException Thrown when the session object is disposed.
Microsoft.Rtc.Signaling . . :: . FailureResponseException Thrown when the server or remote participant returns an error. The response code in the exception should give more information about the error.
Microsoft.Rtc.Signaling . . :: . RealTimeException Encompasses an SIP error or failure cases encountered during sending the message - SIP Transport error, SIP Authentication, and credential-related errors.

See Also