Table of Contents

Class GeneralMessage

Namespace
VAST.WebRTC
Assembly
VAST.WebRTC.dll

Represents a general signaling message exchanged between WebRTC peers via the signaling server.

public class GeneralMessage
Inheritance
GeneralMessage
Inherited Members

Constructors

GeneralMessage()

public GeneralMessage()

Properties

Data

Gets the data payload as a JSON string, or null if the data is not a JSON object.

[JsonIgnore]
public string Data { get; }

Property Value

string

DataInt

Gets or sets the raw data payload of the message.

[JsonPropertyName("data")]
public object DataInt { get; set; }

Property Value

object

DataType

Gets or sets the data type identifier of this message.

[JsonPropertyName("data-type")]
public string DataType { get; set; }

Property Value

string

From

Gets or sets the sender peer identifier.

[JsonPropertyName("from")]
public long From { get; set; }

Property Value

long

PeerList

Gets the data payload deserialized as a list of PeerDescriptor instances, or null if the data is not a JSON array.

[JsonIgnore]
public List<PeerDescriptor> PeerList { get; }

Property Value

List<PeerDescriptor>

Subtype

Gets or sets the message subtype, or null if not specified.

[JsonPropertyName("subtype")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string Subtype { get; set; }

Property Value

string

To

Gets or sets the recipient peer identifier.

[JsonPropertyName("to")]
public long To { get; set; }

Property Value

long

Methods

Deserialize(string)

Deserializes a JSON string into a GeneralMessage instance.

public static GeneralMessage Deserialize(string json)

Parameters

json string

The JSON string to deserialize.

Returns

GeneralMessage

The deserialized GeneralMessage, or null if deserialization fails.

Serialize()

Serializes this instance to a JSON string.

public string Serialize()

Returns

string

The JSON string representation of this message.