Versions in this module Expand all Collapse all v0 v0.10.4 May 20, 2026 v0.10.3 May 19, 2026 Changes in this version + const MAX_MSS_SIZE + const MAX_PASSPHRASE_SIZE + const MAX_PAYLOAD_SIZE + const MAX_STREAMID_SIZE + const MIN_MSS_SIZE + const MIN_PASSPHRASE_SIZE + const MIN_PAYLOAD_SIZE + const SRT_HEADER_SIZE + const SRT_VERSION + const UDP_HEADER_SIZE + var ErrClientClosed = errors.New("srt: client closed") + var ErrListenerClosed = errors.New("srt: listener closed") + var ErrServerClosed = errors.New("srt: server closed") + func DialControl(config Config) func(network string, address string, c syscall.RawConn) error + func ListenControl(config Config) func(network, address string, c syscall.RawConn) error + type AcceptFunc func(req ConnRequest) ConnType + type Config struct + AllowPeerIpChange bool + Congestion string + ConnectionTimeout time.Duration + DriftTracer bool + EnforcedEncryption bool + FC uint32 + GroupConnect bool + GroupStabilityTimeout time.Duration + IPTOS int + IPTTL int + IPv6Only int + InputBW int64 + KMPreAnnounce uint64 + KMRefreshRate uint64 + Latency time.Duration + Logger Logger + LossMaxTTL uint32 + MSS uint32 + MaxBW int64 + MessageAPI bool + MinInputBW int64 + MinVersion uint32 + NAKReport bool + OverheadBW int64 + PBKeylen int + PacketFilter string + Passphrase string + PayloadSize uint32 + PeerIdleTimeout time.Duration + PeerLatency time.Duration + ReceiverBufferSize uint32 + ReceiverLatency time.Duration + SendBufferSize uint32 + SendDropDelay time.Duration + StreamId string + TSBPDMode bool + TooLatePacketDrop bool + TransmissionType string + func DefaultConfig() Config + func (c *Config) MarshalQuery() string + func (c *Config) MarshalURL(address string) string + func (c *Config) UnmarshalQuery(query string) error + func (c *Config) UnmarshalURL(srturl string) (string, error) + func (c *Config) Validate() error + type Conn interface + Close func() error + LocalAddr func() net.Addr + PeerSocketId func() uint32 + Read func(p []byte) (int, error) + ReadPacket func() (packet.Packet, error) + RemoteAddr func() net.Addr + SetDeadline func(t time.Time) error + SetReadDeadline func(t time.Time) error + SetWriteDeadline func(t time.Time) error + SocketId func() uint32 + Stats func(s *Statistics) + StreamId func() string + Version func() uint32 + Write func(p []byte) (int, error) + WritePacket func(p packet.Packet) error + func Dial(network, address string, config Config) (Conn, error) + type ConnRequest interface + Accept func() (Conn, error) + IsEncrypted func() bool + PeerSocketId func() uint32 + Reject func(r RejectionReason) + RemoteAddr func() net.Addr + SetPassphrase func(p string) error + SetRejectionReason func(r RejectionReason) + SocketId func() uint32 + StreamId func() string + Version func() uint32 + type ConnType int + const PUBLISH + const REJECT + const SUBSCRIBE + func (c ConnType) String() string + type Listener interface + Accept func(AcceptFunc) (Conn, ConnType, error) + Accept2 func() (ConnRequest, error) + Addr func() net.Addr + Close func() + func Listen(network, address string, config Config) (Listener, error) + type Log struct + File string + Line int + Message string + SocketId uint32 + Time time.Time + Topic string + type Logger interface + Close func() + HasTopic func(topic string) bool + Listen func() <-chan Log + Print func(topic string, socketId uint32, skip int, message func() string) + func NewLogger(topics []string) Logger + type PubSub interface + Publish func(c Conn) error + Subscribe func(c Conn) error + func NewPubSub(config PubSubConfig) PubSub + type PubSubConfig struct + Logger Logger + type RejectionReason uint32 + const REJX_BAD_MODE + const REJX_BAD_REQUEST + const REJX_CONFLICT + const REJX_DOWN + const REJX_FAILED_DEPEND + const REJX_FORBIDDEN + const REJX_GW + const REJX_ISE + const REJX_LOCKED + const REJX_NOROOM + const REJX_NOTFOUND + const REJX_NOTSUP_MEDIA + const REJX_OVERLOAD + const REJX_UNACCEPTABLE + const REJX_UNAUTHORIZED + const REJX_UNIMPLEMENTED + const REJX_VERSION + const REJ_BACKLOG + const REJ_BADSECRET + const REJ_CLOSE + const REJ_CONGESTION + const REJ_FILTER + const REJ_GROUP + const REJ_IPE + const REJ_MESSAGEAPI + const REJ_PEER + const REJ_RDVCOOKIE + const REJ_RESOURCE + const REJ_ROGUE + const REJ_SYSTEM + const REJ_UNKNOWN + const REJ_UNSECURE + const REJ_VERSION + type Server struct + Addr string + Config *Config + HandleConnect AcceptFunc + HandlePublish func(conn Conn) + HandleSubscribe func(conn Conn) + func (s *Server) Listen() error + func (s *Server) ListenAndServe() error + func (s *Server) Serve() error + func (s *Server) Shutdown() + type Statistics struct + Accumulated StatisticsAccumulated + Instantaneous StatisticsInstantaneous + Interval StatisticsInterval + MsTimeStamp uint64 + type StatisticsAccumulated struct + ByteRecv uint64 + ByteRecvBelated uint64 + ByteRecvDrop uint64 + ByteRecvLoss uint64 + ByteRecvRetrans uint64 + ByteRecvUndecrypt uint64 + ByteRecvUnique uint64 + ByteRetrans uint64 + ByteSendDrop uint64 + ByteSent uint64 + ByteSentUnique uint64 + PktRecv uint64 + PktRecvACK uint64 + PktRecvBelated uint64 + PktRecvDrop uint64 + PktRecvKM uint64 + PktRecvLoss uint64 + PktRecvNAK uint64 + PktRecvRetrans uint64 + PktRecvUndecrypt uint64 + PktRecvUnique uint64 + PktRetrans uint64 + PktSendDrop uint64 + PktSendLoss uint64 + PktSent uint64 + PktSentACK uint64 + PktSentKM uint64 + PktSentNAK uint64 + PktSentUnique uint64 + UsSndDuration uint64 + type StatisticsInstantaneous struct + ByteAvailRecvBuf uint64 + ByteAvailSendBuf uint64 + ByteMSS uint64 + ByteRecvBuf uint64 + ByteSendBuf uint64 + MbpsLinkCapacity float64 + MbpsMaxBW float64 + MbpsRecvRate float64 + MbpsSentRate float64 + MsRTT float64 + MsRecvBuf uint64 + MsRecvTsbPdDelay uint64 + MsSendBuf uint64 + MsSendTsbPdDelay uint64 + PktFlightSize uint64 + PktFlowWindow uint64 + PktRecvAvgBelatedTime uint64 + PktRecvBuf uint64 + PktRecvLossRate float64 + PktReorderTolerance uint64 + PktSendBuf uint64 + PktSendLossRate float64 + UsPktSendPeriod float64 + type StatisticsInterval struct + ByteRecv uint64 + ByteRecvBelated uint64 + ByteRecvDrop uint64 + ByteRecvLoss uint64 + ByteRecvRetrans uint64 + ByteRecvUndecrypt uint64 + ByteRecvUnique uint64 + ByteRetrans uint64 + ByteSendDrop uint64 + ByteSent uint64 + ByteSentUnique uint64 + MbpsRecvRate float64 + MbpsSendRate float64 + MsInterval uint64 + PktRecv uint64 + PktRecvACK uint64 + PktRecvBelated uint64 + PktRecvDrop uint64 + PktRecvLoss uint64 + PktRecvNAK uint64 + PktRecvRetrans uint64 + PktRecvUndecrypt uint64 + PktRecvUnique uint64 + PktReorderDistance uint64 + PktRetrans uint64 + PktSendLoss uint64 + PktSent uint64 + PktSentACK uint64 + PktSentNAK uint64 + PktSentUnique uint64 + PktSndDrop uint64 + UsSndDuration uint64