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
Visual Basic (Declaration) |
---|
Public Function SendMessage ( _ messageType As MessageType, _ contentType As ContentType, _ body As Byte() _ ) As SipResponseData |
C# |
---|
public SipResponseData SendMessage( MessageType messageType, ContentType contentType, byte[] body ) |
Visual C++ |
---|
public: SipResponseData^ SendMessage( MessageType messageType, ContentType^ contentType, array< unsigned char>^ body ) |
JavaScript |
---|
function sendMessage( messageType, contentType, body); |
Parameters
- messageType
- Type:
Microsoft.Rtc.Signaling
.
.
::
.
MessageType
Type of the body (message or info).
- contentType
- Type:
ContentType
Content type describing the body. If null text/plain, UTF-8 is assumed.
- body
- Type:
array<
Byte
>
[]
()
[]
Body for the data.
Return Value
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 a non-null is expected for an argument. The argument name for which a non-null is expected is part of the exception message. |
Microsoft.Rtc.Signaling . . :: . FailureResponseException | Thrown when the server or remote participant returns an error. The SipResponseData in the exception should give additional information. |
Microsoft.Rtc.Signaling . . :: . RealTimeException | Thrown when some other unknown errors occur. |
Microsoft.Rtc.Signaling . . :: . ServerPolicyException | A server policy setting does not allow the sending of the message. |