srt

package
v2.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package srt implements the SRT server: it routes every SRT flow by the stream it names to the endpoint holding the stream and relays it, the stream's encryption untouched. The first flow naming a stream places it on an endpoint of the server's clusters by the load-balancing policy; every later flow naming it, publisher or reader, goes to the same endpoint.

Index

Constants

This section is empty.

Variables

View Source
var (
	// FlowTimeout is the idle timeout of a relayed flow: SRT peers send keepalives every second
	// and give up on a peer silent for 5 seconds.
	FlowTimeout = 10 * time.Second
	// HandshakeTimeout bounds a caller's handshake, the endpoint's included.
	HandshakeTimeout = 10 * time.Second
	// RetryPeriod is how often the server repeats a handshake towards an endpoint that is silent.
	RetryPeriod = 250 * time.Millisecond
	// CookiePeriod is how long a SYN cookie is valid: the cookie of the current and of the
	// previous period are accepted.
	CookiePeriod = time.Minute
)

Functions

func Resource

func Resource(sid string) string

Resource returns the stream a stream ID names: the r= key of the access control syntax (#!::r=live/van7,m=publish), else the whole stream ID.

Types

type Server

type Server struct {
	server.Base
	// contains filtered or unexported fields
}

Server is an SRT server object.

func New

func New(conf *stnrv2.ServerConfig, rt *objruntime.Runtime) (*Server, error)

New creates the SRT server of a validated config.

func (*Server) Close

func (s *Server) Close(_ bool) error

Close tears down every flow and gives back the quota of every stream.

func (*Server) GetConfig

func (s *Server) GetConfig() stnrv2.Config

func (*Server) Reconcile

func (s *Server) Reconcile(conf stnrv2.Config) error

Reconcile applies the spec, the linger period and the load-balancing policy to the next flows.

func (*Server) Serve

func (s *Server) Serve(c api.Conn) (api.Conn, api.Verdict, error)

Serve takes the conn of a caller.

func (*Server) Sessions

func (s *Server) Sessions() int

Sessions returns the number of relayed flows.

func (*Server) Start

func (s *Server) Start() error

Start starts serving with no streams placed.

func (*Server) Status

func (s *Server) Status() stnrv2.Status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL