Table of Contents

Class StreamingServer

Namespace
VAST.Network
Assembly
VAST.Network.dll

Represents the main streaming server that manages publishing points, protocol-specific sub-servers (RTMP, RTSP, SRT, WebRTC, HLS, MPEG-DASH, etc.), sources, sinks, and client connections.

public class StreamingServer
Inheritance
StreamingServer
Inherited Members

Constructors

StreamingServer(int)

Initializes a new instance of the StreamingServer class.

public StreamingServer(int maxConnectionCount = 1000)

Parameters

maxConnectionCount int

The maximum number of simultaneous connections allowed. Default is 1000.

Properties

ApiServerParameters

Gets or sets the API server parameters.

public ApiServerParameters ApiServerParameters { get; set; }

Property Value

ApiServerParameters

CacheFolder

Gets or sets cache folder used to write files to by default. Also used to resolve $(CacheFolder) macro in API request.

public string CacheFolder { get; set; }

Property Value

string

CertificateThumbprint

Gets or sets the SSL/TLS certificate thumbprint used by protocol servers that support encryption.

public string CertificateThumbprint { get; set; }

Property Value

string

DashServerParameters

Gets or sets the MPEG-DASH server parameters.

public DashServerParameters DashServerParameters { get; set; }

Property Value

DashServerParameters

EnableFileCache

Gets or sets a value indicating whether the file cache is enabled for VOD publishing points.

public bool EnableFileCache { get; set; }

Property Value

bool

EnableHls

Gets or sets a value indicating whether the HLS server is enabled.

public bool EnableHls { get; set; }

Property Value

bool

EnableHttp

Gets or sets a value indicating whether the HTTP server is enabled.

public bool EnableHttp { get; set; }

Property Value

bool

EnableJsonApi

Gets or sets a value indicating whether the JSON API server is enabled.

public bool EnableJsonApi { get; set; }

Property Value

bool

EnableMjpeg

Gets or sets a value indicating whether the MJPEG server is enabled.

public bool EnableMjpeg { get; set; }

Property Value

bool

EnableMpegDash

Gets or sets a value indicating whether the MPEG-DASH server is enabled.

public bool EnableMpegDash { get; set; }

Property Value

bool

EnableRtmp

Gets or sets a value indicating whether the RTMP server is enabled.

public bool EnableRtmp { get; set; }

Property Value

bool

EnableRtsp

Gets or sets a value indicating whether the RTSP server is enabled.

public bool EnableRtsp { get; set; }

Property Value

bool

EnableSrt

Gets or sets a value indicating whether the SRT server is enabled.

public bool EnableSrt { get; set; }

Property Value

bool

EnableStat

Gets or sets a value indicating whether server performance statistics collection is enabled.

public bool EnableStat { get; set; }

Property Value

bool

EnableTcpServer

Gets or sets a value indicating whether the raw TCP server is enabled.

public bool EnableTcpServer { get; set; }

Property Value

bool

EnableTsHttp

Gets or sets a value indicating whether the TS over HTTP server is enabled.

public bool EnableTsHttp { get; set; }

Property Value

bool

EnableWebRtc

Gets or sets a value indicating whether the WebRTC server is enabled.

public bool EnableWebRtc { get; set; }

Property Value

bool

EnableWebTransport

Gets or sets a value indicating whether the WebTransport server is enabled.

public bool EnableWebTransport { get; set; }

Property Value

bool

EnableWsPcm

Gets or sets a value indicating whether the WebSocket PCM audio server is enabled.

public bool EnableWsPcm { get; set; }

Property Value

bool

FileTransferRequestedHandler

Gets or sets the delegate that handles file transfer requests.

public FileTransferRequestedDelegate FileTransferRequestedHandler { get; set; }

Property Value

FileTransferRequestedDelegate

HlsServerParameters

Gets or sets the HLS server parameters.

public HlsServerParameters HlsServerParameters { get; set; }

Property Value

HlsServerParameters

HttpServer

Gets the HTTP server instance used by this streaming server.

public HttpServer HttpServer { get; }

Property Value

HttpServer

HttpServerParameters

Gets or sets the HTTP server parameters.

public HttpServerParameters HttpServerParameters { get; set; }

Property Value

HttpServerParameters

MjpegServerParameters

Gets or sets the MJPEG server parameters.

public MjpegServerParameters MjpegServerParameters { get; set; }

Property Value

MjpegServerParameters

RtmpServerParameters

Gets or sets the RTMP server parameters.

public RtmpServerParameters RtmpServerParameters { get; set; }

Property Value

RtmpServerParameters

RtspServerParameters

Gets or sets the RTSP server parameters.

public RtspServerParameters RtspServerParameters { get; set; }

Property Value

RtspServerParameters

SrtServerParameters

Gets or sets the SRT server parameters.

public SrtServerParameters SrtServerParameters { get; set; }

Property Value

SrtServerParameters

Stat

Gets the server performance statistics collector.

public StreamingServerStat Stat { get; }

Property Value

StreamingServerStat

TcpServerParameters

Gets or sets the TCP server parameters.

public TcpServerParameters TcpServerParameters { get; set; }

Property Value

TcpServerParameters

TsHttpServerParameters

Gets or sets the TS over HTTP server parameters.

public TsHttpServerParameters TsHttpServerParameters { get; set; }

Property Value

TsHttpServerParameters

WebRtcServerParameters

Gets or sets the WebRTC server parameters.

public WebRtcServerParameters WebRtcServerParameters { get; set; }

Property Value

WebRtcServerParameters

WebTransportServerParameters

Gets or sets the WebTransport server parameters.

public WebTransportServerParameters WebTransportServerParameters { get; set; }

Property Value

WebTransportServerParameters

WsPcmServerParameters

Gets or sets the WebSocket PCM audio server parameters.

public WsPcmServerParameters WsPcmServerParameters { get; set; }

Property Value

WsPcmServerParameters

Methods

CreatePublishingPoint(string, string, StreamingMode, PublishingPointParameters)

Create new publishing point with the pull source (eg RTSP pull).

public Guid CreatePublishingPoint(string publishingPath, string sourceUri, StreamingMode streamingMode, PublishingPointParameters additionalParameters = null)

Parameters

publishingPath string

Path to use for publishing point. It'll be used for example to serve client request rtmp://server/live/publishingPath

sourceUri string

Source URI to pull media data from

streamingMode StreamingMode

Streaming mode

additionalParameters PublishingPointParameters

Optional additional parameters

Returns

Guid

CreatePublishingPoint(string, string, PublishingPointParameters)

Create new publishing point with the pull source (eg RTSP pull).

public Guid CreatePublishingPoint(string publishingPath, string sourceUri, PublishingPointParameters additionalParameters = null)

Parameters

publishingPath string

Path to use for publishing point. It'll be used for example to serve client request rtmp://server/live/publishingPath

sourceUri string

Source URI to pull media data from

additionalParameters PublishingPointParameters

Optional additional parameters

Returns

Guid

CreatePublishingPoint(string, IMediaSource, StreamingMode, PublishingPointParameters)

Create new publishing point with the provided source

public Guid CreatePublishingPoint(string publishingPath, IMediaSource source, StreamingMode streamingMode, PublishingPointParameters additionalParameters = null)

Parameters

publishingPath string

Path to use for publishing point. It'll be used for example to serve client request rtmp://server/live/publishingPath

source IMediaSource

Source to pull media data from

streamingMode StreamingMode

Streaming mode

additionalParameters PublishingPointParameters

Optional additional parameters

Returns

Guid

CreatePublishingPoint(string, IMediaSource, PublishingPointParameters)

Create new publishing point with the provided source

public Guid CreatePublishingPoint(string publishingPath, IMediaSource source, PublishingPointParameters additionalParameters = null)

Parameters

publishingPath string

Path to use for publishing point. It'll be used for example to serve client request rtmp://server/live/publishingPath

source IMediaSource

Source to pull media data from

additionalParameters PublishingPointParameters

Optional additional parameters

Returns

Guid

GetConnectedClient(Guid)

Gets client based on its connection id

public ConnectedClient GetConnectedClient(Guid connectionId)

Parameters

connectionId Guid

Connection id of client

Returns

ConnectedClient

Client if found, null otherwise

GetPublishingPoint(Guid)

Gets publishing point (published stream) based on its connection id

public PublishingPoint GetPublishingPoint(Guid connectionId)

Parameters

connectionId Guid

Connection id of the source

Returns

PublishingPoint

Publishing point if found, null otherwise

GetPublishingPoint(string)

Gets publishing point (published stream) based on its publishing path

public PublishingPoint GetPublishingPoint(string publishingPath)

Parameters

publishingPath string

Publishing path

Returns

PublishingPoint

Publishing point if found, null otherwise

GetPublishingPoints()

Gets immediate snapshot of active publishing points

public List<PublishingPoint> GetPublishingPoints()

Returns

List<PublishingPoint>

List of active publishing points

GetSource(Guid)

Gets a media source by its unique identifier.

public IMediaSource GetSource(Guid sourceId)

Parameters

sourceId Guid

The unique identifier of the source.

Returns

IMediaSource

The media source if found; otherwise, null.

IsPublishingPointInUse(Guid)

Checks if publishing point is in use, i.e. has at least one connected client

public bool IsPublishingPointInUse(Guid connectionId)

Parameters

connectionId Guid

Connection id of the source

Returns

bool

True if publishing point is in use, false otherwise

IsPublishingPointInUse(string)

Checks if publishing point is in use, i.e. has at least one connected client

public bool IsPublishingPointInUse(string publishingPath)

Parameters

publishingPath string

Publishing path

Returns

bool

True if publishing point is in use, false otherwise

ResolveMacros(string)

Resolves macro placeholders in the specified string, such as $(CacheFolder).

public string ResolveMacros(string stringToResolve)

Parameters

stringToResolve string

The string containing macros to resolve.

Returns

string

The string with all macros replaced by their actual values.

Start()

Starts the streaming server with all enabled protocol sub-servers.

public void Start()

Start(HttpListener)

Starts the streaming server using the specified HTTP listener.

public void Start(HttpListener httpListener)

Parameters

httpListener HttpListener

The HTTP listener to use for HTTP-based protocols.

Start(HttpServer)

Starts the streaming server using the specified HTTP server instance.

public void Start(HttpServer httpServer)

Parameters

httpServer HttpServer

The HTTP server instance to use, or null to create a new one if HTTP is enabled.

Stop()

Stops the streaming server, shutting down all publishing points and protocol sub-servers, and releasing all resources.

public void Stop()

Update()

Updates the streaming server settings by detecting changes to protocol configurations, stopping affected sub-servers, and restarting them with the new settings.

public void Update()

Events

Authorize

Occurs when a connection requires authorization.

public event StreamingServer.AuthorizeHandler Authorize

Event Type

StreamingServer.AuthorizeHandler

ClientConnected

Occurs when a client has connected to a publishing point.

public event StreamingServer.ClientConnectedHandler ClientConnected

Event Type

StreamingServer.ClientConnectedHandler

Disconnected

Occurs when a connection is disconnected.

public event StreamingServer.DisconnectedHandler Disconnected

Event Type

StreamingServer.DisconnectedHandler

Error

Occurs when an error is encountered during connection processing.

public event StreamingServer.ErrorHandler Error

Event Type

StreamingServer.ErrorHandler

PublisherConnected

Occurs when a publisher has connected and a publishing point has been created.

public event StreamingServer.PublisherConnectedHandler PublisherConnected

Event Type

StreamingServer.PublisherConnectedHandler

PublishingPointDisposing

Occurs when a publishing point is about to be disposed.

public event StreamingServer.PublishingPointDisposingHandler PublishingPointDisposing

Event Type

StreamingServer.PublishingPointDisposingHandler

PublishingPointRequested

Occurs when a new publishing point is requested by a client connection.

public event StreamingServer.PublishingPointRequestedHandler PublishingPointRequested

Event Type

StreamingServer.PublishingPointRequestedHandler

ReceivedApiCommand

Occurs when an unknown API command is received by the server.

public event StreamingServer.ReceivedCommandHandler ReceivedApiCommand

Event Type

StreamingServer.ReceivedCommandHandler