Table of Contents

Class UDPSinkSettings

Namespace
VisioForge.Core.Types.X.Sinks
Assembly
VisioForge.Core.dll

UDP sink settings for streaming data over UDP to a single destination.

public class UDPSinkSettings : UDPSinkSettingsBase, IMediaBlockSettings

Inheritance

Implements

Inherited Members

Properties

Host

The host/IP/Multicast group to send the packets to. Defaults to "localhost".

public string Host { get; set; }

Property Value

string

Port

The port to send the packets to. Defaults to 5004.

public int Port { get; set; }

Property Value

int

Methods

CreateBlock()

Creates the media block instance for UDP sink.

public override MediaBlock CreateBlock()

Returns

MediaBlock

A new instance of VisioForge.Core.MediaBlocks.Sinks.UDPSinkBlock configured with these settings.

ToUrl()

Constructs a UDP URL from the current Host and Port properties.

public string ToUrl()

Returns

string

A string in the format "udp://host:port".

TryParseUrl(string)

Parses a UDP URL and updates the Host and Port properties.

public bool TryParseUrl(string url)

Parameters

url string

The URL to parse, expected in the format "udp://host:port".

Returns

bool

true if the URL was successfully parsed; otherwise, false.

TryParseUrl(string, out string, out int)

Parses a udp://host:port URL into VisioForge.Core.Types.X.Sinks.UDPSinkSettings.Host and VisioForge.Core.Types.X.Sinks.UDPSinkSettings.Port, and hands the parsed pair back to the caller.

public bool TryParseUrl(string url, out string host, out int port)

Parameters

url string

The URL.

host string

The parsed host. Undefined when the method returns false.

port int

The parsed port. Undefined when the method returns false.

Returns

bool

true when the URL parsed.

Remarks

A caller that retargets a running sink must push the pair this returns, not read VisioForge.Core.Types.X.Sinks.UDPSinkSettings.Host and VisioForge.Core.Types.X.Sinks.UDPSinkSettings.Port back off these settings afterwards: two threads retargeting at once both write here, so the two reads can straddle the other's write and produce a host and a port from different URLs. GitHub issue #948.

That is all this buys, and the limit is worth stating. VisioForge.Core.Types.X.Sinks.UDPSinkSettings.Host and VisioForge.Core.Types.X.Sinks.UDPSinkSettings.Port remain two independent stores on a settings object with no lock, so concurrent callers can still leave *these properties* holding a host from one URL and a port from another - which VisioForge.Core.Types.X.Sinks.UDPSinkSettings.ToUrl will then report, and which a later rebuild through ApplySettings will push. Nor is parse order push order. What is guaranteed is only that the pair handed to one caller came from one URL.