Table of Contents

Class NetworkSourceDisconnectEventArgs

Namespace
VisioForge.Core.Types.Events
Assembly
VisioForge.Core.dll

Provides data for events that indicate a network source has disconnected or encountered a connection error. This class encapsulates information about the disconnected source, including the element name, error details, and the source URI when available.

public class NetworkSourceDisconnectEventArgs : EventArgs

Inheritance

Inherited Members

Examples

pipeline.OnNetworkSourceDisconnect += (sender, e) =>
{
    Console.WriteLine($"[{e.Timestamp}] Network source disconnected: {e.SourceElementName}");
    Console.WriteLine($"  URI: {e.Uri}");
    Console.WriteLine($"  Error: {e.ErrorMessage}");
};

Remarks

This event is raised when a network source element (such as RTSP, HTTP, SRT, NDI, or RTMP) posts an error on the GStreamer bus indicating a connection failure or stream interruption. The SourceElementName identifies which GStreamer element reported the error, useful when multiple network sources exist in a single pipeline. The Uri property, when available, provides the network address that was being accessed when the disconnect occurred. Applications should implement appropriate recovery strategies such as reconnecting, switching to a fallback source, or notifying the user about the connection loss. Network disconnect events are raised from the GStreamer bus thread; ensure thread-safe handling when updating UI elements.

Constructors

NetworkSourceDisconnectEventArgs(string, string, string, string)

Initializes a new instance of the VisioForge.Core.Types.Events.NetworkSourceDisconnectEventArgs class.

public NetworkSourceDisconnectEventArgs(string sourceElementName, string errorMessage, string debugInfo = null, string uri = null)

Parameters

sourceElementName string

The name of the GStreamer element that reported the error.

errorMessage string

The error message describing the disconnection.

debugInfo string

Optional GStreamer debug information.

uri string

Optional URI of the disconnected source.

Properties

DebugInfo

Gets the GStreamer debug information associated with the error, providing additional diagnostic details. May be null or empty if no debug information is available.

public string DebugInfo { get; }

Property Value

string

ErrorMessage

Gets the error message from the GStreamer element describing the nature of the disconnection.

public string ErrorMessage { get; }

Property Value

string

SourceElementName

Gets the name of the GStreamer source element that reported the network error. This identifies which network source in the pipeline experienced the disconnection.

public string SourceElementName { get; }

Property Value

string

Timestamp

Gets the timestamp when the disconnection was detected.

public DateTime Timestamp { get; }

Property Value

DateTime

Uri

Gets the URI of the network source that disconnected, if available. May be null if the URI could not be retrieved from the source element.

public string Uri { get; }

Property Value

string