Documentation
¶
Overview ¶
Package srt provides an interface for network I/O using the SRT protocol (https://github.com/Haivision/srt).
The package gives access to the basic interface provided by the Dial, Listen, and Accept functions and the associated Conn and Listener interfaces.
The Dial function connects to a server:
conn, err := srt.Dial("srt", "golang.org:6000", srt.Config{
StreamId: "...",
})
if err != nil {
// handle error
}
buffer := make([]byte, 2048)
for {
n, err := conn.Read(buffer)
if err != nil {
// handle error
}
// handle received data
}
conn.Close()
The Listen function creates servers:
ln, err := srt.Listen("srt", ":6000", srt.Config{...})
if err != nil {
// handle error
}
for {
conn, mode, err := ln.Accept(handleConnect)
if err != nil {
// handle error
}
if mode == srt.REJECT {
// rejected connection, ignore
continue
}
if mode == srt.PUBLISH {
go handlePublish(conn)
} else {
go handleSubscribe(conn)
}
}
The ln.Accept function expects a function that takes a srt.ConnRequest and returns a srt.ConnType. The srt.ConnRequest lets you retrieve the streamid with on which you can decide what mode (srt.ConnType) to return.
Check out the Server type that wraps the Listen and Accept into a convenient framework for your own SRT server.
Index ¶
- Constants
- Variables
- 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
- type Config
- type Conn
- type ConnRequest
- type ConnType
- type Listener
- type Log
- type Logger
- type PubSub
- type PubSubConfig
- type RejectionReason
- type Server
- type Statistics
- type StatisticsAccumulated
- type StatisticsInstantaneous
- type StatisticsInterval
Constants ¶
const ( UDP_HEADER_SIZE = 28 SRT_HEADER_SIZE = 16 MIN_MSS_SIZE = 76 MAX_MSS_SIZE = 1500 MIN_PAYLOAD_SIZE = MIN_MSS_SIZE - UDP_HEADER_SIZE - SRT_HEADER_SIZE MAX_PAYLOAD_SIZE = MAX_MSS_SIZE - UDP_HEADER_SIZE - SRT_HEADER_SIZE MIN_PASSPHRASE_SIZE = 10 MAX_PASSPHRASE_SIZE = 80 MAX_STREAMID_SIZE = 512 SRT_VERSION = 0x010401 )
Variables ¶
var ErrClientClosed = errors.New("srt: client closed")
ErrClientClosed is returned when the client connection has been voluntarily closed.
var ErrListenerClosed = errors.New("srt: listener closed")
ErrListenerClosed is returned when the listener is about to shutdown.
var ErrServerClosed = errors.New("srt: server closed")
ErrServerClosed is returned when the server is about to shutdown.
Functions ¶
func DialControl ¶ added in v0.5.1
Types ¶
type AcceptFunc ¶
type AcceptFunc func(req ConnRequest) ConnType
AcceptFunc receives a connection request and returns the type of connection and is required by the Listener for each Accept of a new connection.
type Config ¶
type Config struct {
// Type of congestion control. 'live' or 'file'
// SRTO_CONGESTION
Congestion string
// Connection timeout.
// SRTO_CONNTIMEO
ConnectionTimeout time.Duration
// Enable drift tracer.
// SRTO_DRIFTTRACER
DriftTracer bool
// Reject connection if parties set different passphrase.
// SRTO_ENFORCEDENCRYPTION
EnforcedEncryption bool
// Flow control window size. Packets.
// SRTO_FC
FC uint32
// Accept group connections.
// SRTO_GROUPCONNECT
GroupConnect bool
// Group stability timeout.
// SRTO_GROUPSTABTIMEO
GroupStabilityTimeout time.Duration
// Input bandwidth. Bytes.
// SRTO_INPUTBW
InputBW int64
// IP socket type of service
// SRTO_IPTOS
IPTOS int
// Defines IP socket "time to live" option.
// SRTO_IPTTL
IPTTL int
// Allow only IPv6.
// SRTO_IPV6ONLY
IPv6Only int
// Duration of Stream Encryption key switchover. Packets.
// SRTO_KMPREANNOUNCE
KMPreAnnounce uint64
// Stream encryption key refresh rate. Packets.
// SRTO_KMREFRESHRATE
KMRefreshRate uint64
// Defines the maximum accepted transmission latency.
// SRTO_LATENCY
Latency time.Duration
// Packet reorder tolerance.
// SRTO_LOSSMAXTTL
LossMaxTTL uint32
// Bandwidth limit in bytes/s.
// SRTO_MAXBW
MaxBW int64
// Enable SRT message mode.
// SRTO_MESSAGEAPI
MessageAPI bool
// Minimum input bandwidth
// This option is effective only if both SRTO_MAXBW and SRTO_INPUTBW are set to 0. It controls the minimum allowed value of the input bitrate estimate.
// SRTO_MININPUTBW
MinInputBW int64
// Minimum SRT library version of a peer.
// SRTO_MINVERSION
MinVersion uint32
// MTU size
// SRTO_MSS
MSS uint32
// Enable periodic NAK reports
// SRTO_NAKREPORT
NAKReport bool
// Limit bandwidth overhead, percents
// SRTO_OHEADBW
OverheadBW int64
// Set up the packet filter.
// SRTO_PACKETFILTER
PacketFilter string
// Password for the encrypted transmission.
// SRTO_PASSPHRASE
Passphrase string
// Maximum payload size. Bytes.
// SRTO_PAYLOADSIZE
PayloadSize uint32
// Crypto key length in bytes.
// SRTO_PBKEYLEN
PBKeylen int
// Peer idle timeout.
// SRTO_PEERIDLETIMEO
PeerIdleTimeout time.Duration
// Minimum receiver latency to be requested by sender.
// SRTO_PEERLATENCY
PeerLatency time.Duration
// Receiver buffer size. Bytes.
// SRTO_RCVBUF
ReceiverBufferSize uint32
// Receiver-side latency.
// SRTO_RCVLATENCY
ReceiverLatency time.Duration
// Sender buffer size. Bytes.
// SRTO_SNDBUF
SendBufferSize uint32
// Sender's delay before dropping packets.
// SRTO_SNDDROPDELAY
SendDropDelay time.Duration
// Stream ID (settable in caller mode only, visible on the listener peer)
// SRTO_STREAMID
StreamId string
// Drop too late packets.
// SRTO_TLPKTDROP
TooLatePacketDrop bool
// Transmission type. 'live' or 'file'.
// SRTO_TRANSTYPE
TransmissionType string
// Timestamp-based packet delivery mode.
// SRTO_TSBPDMODE
TSBPDMode bool
// An implementation of the Logger interface
Logger Logger
// if a new IP starts sending data on an existing socket id, allow it
AllowPeerIpChange bool
}
Config is the configuration for a SRT connection
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default configuration for Dial and Listen.
func (*Config) MarshalQuery ¶
MarshalQuery returns the corresponding query string for a configuration.
func (*Config) MarshalURL ¶
MarshalURL returns the SRT URL for this config and the given address (host:port).
func (*Config) UnmarshalQuery ¶
UnmarshalQuery parses a query string and interprets it as a configuration for a SRT connection. The key in each key/value pair corresponds to the respective field in the Config type, but with only lower case letters. Bool values can be represented as "true"/"false", "on"/"off", "yes"/"no", or "0"/"1".
func (*Config) UnmarshalURL ¶
UnmarshalURL takes a SRT URL and parses out the configuration. A SRT URL is srt://[host]:[port]?[key1]=[value1]&[key2]=[value2]... It returns the host:port of the URL.
type Conn ¶
type Conn interface {
// Read reads data from the connection.
// Read can be made to time out and return an error after a fixed
// time limit; see SetDeadline and SetReadDeadline.
Read(p []byte) (int, error)
// ReadPacket reads a packet from the queue of received packets. It blocks
// if the queue is empty. Only data packets are returned. Using ReadPacket
// and Read at the same time may lead to data loss.
ReadPacket() (packet.Packet, error)
// Write writes data to the connection.
// Write can be made to time out and return an error after a fixed
// time limit; see SetDeadline and SetWriteDeadline.
Write(p []byte) (int, error)
// WritePacket writes a packet to the write queue. Packets on the write queue
// will be sent to the peer of the connection. Only data packets will be sent.
WritePacket(p packet.Packet) error
// Close closes the connection.
// Any blocked Read or Write operations will be unblocked and return errors.
Close() error
// LocalAddr returns the local network address. The returned net.Addr is not shared by other invocations of LocalAddr.
LocalAddr() net.Addr
// RemoteAddr returns the remote network address. The returned net.Addr is not shared by other invocations of RemoteAddr.
RemoteAddr() net.Addr
SetDeadline(t time.Time) error
SetReadDeadline(t time.Time) error
SetWriteDeadline(t time.Time) error
// SocketId return the socketid of the connection.
SocketId() uint32
// PeerSocketId returns the socketid of the peer of the connection.
PeerSocketId() uint32
// StreamId returns the streamid use for the connection.
StreamId() string
// Stats returns accumulated and instantaneous statistics of the connection.
Stats(s *Statistics)
// Version returns the connection version, either 4 or 5. With version 4, the streamid is not available
Version() uint32
}
Conn is a SRT network connection.
type ConnRequest ¶
type ConnRequest interface {
// RemoteAddr returns the address of the peer. The returned net.Addr
// is a copy and can be used at will.
RemoteAddr() net.Addr
// Version returns the handshake version of the incoming request. Currently
// known versions are 4 and 5. With version 4 the StreamId will always be
// empty and IsEncrypted will always return false. An incoming version 4
// connection will always be publishing.
Version() uint32
// StreamId returns the streamid of the requesting connection. Use this
// to decide what to do with the connection.
StreamId() string
// IsEncrypted returns whether the connection is encrypted. If it is
// encrypted, use SetPassphrase to set the passphrase for decrypting.
IsEncrypted() bool
// SetPassphrase sets the passphrase in order to decrypt the incoming
// data. Returns an error if the passphrase did not work or the connection
// is not encrypted.
SetPassphrase(p string) error
// SetRejectionReason sets the rejection reason for the connection. If
// no set, REJ_PEER will be used.
//
// Deprecated: replaced by Reject().
SetRejectionReason(r RejectionReason)
// Accept accepts the request and returns a connection.
Accept() (Conn, error)
// Reject rejects the request.
Reject(r RejectionReason)
}
ConnRequest is an incoming connection request
type ConnType ¶
type ConnType int
ConnType represents the kind of connection as returned from the AcceptFunc. It is one of REJECT, PUBLISH, or SUBSCRIBE.
type Listener ¶
type Listener interface {
// Accept2 waits for new connections.
// On closing the err will be ErrListenerClosed.
Accept2() (ConnRequest, error)
// Accept waits for new connections. For each new connection the AcceptFunc
// gets called. Conn is a new connection if AcceptFunc is PUBLISH or SUBSCRIBE.
// If AcceptFunc returns REJECT, Conn is nil. In case of failure error is not
// nil, Conn is nil and ConnType is REJECT. On closing the listener err will
// be ErrListenerClosed and ConnType is REJECT.
//
// Deprecated: replaced by Accept2().
Accept(AcceptFunc) (Conn, ConnType, error)
// Close closes the listener. It will stop accepting new connections and
// close all currently established connections.
Close()
// Addr returns the address of the listener.
Addr() net.Addr
}
Listener waits for new connections
func Listen ¶
Listen returns a new listener on the SRT protocol on the address with the provided config. The network parameter needs to be "srt".
The address has the form "host:port".
Examples:
Listen("srt", "127.0.0.1:3000", DefaultConfig())
In case of an error, the returned Listener is nil and the error is non-nil.
type Log ¶
type Log struct {
Time time.Time // Time of when this message has been logged
SocketId uint32 // The socketid if connection related, 0 otherwise
Topic string // The topic of this message
Message string // The message itself
File string // The file in which this message has been dispatched
Line int // The line number in the file in which this message has been dispatched
}
Log represents a log message
type Logger ¶
type Logger interface {
// HasTopic returns whether this Logger is logging messages of that topic.
HasTopic(topic string) bool
// Print adds a new message to the message queue. The message itself is
// a function that returns the string to be logges. It will only be
// executed if HasTopic returns true on the given topic.
Print(topic string, socketId uint32, skip int, message func() string)
// Listen returns a read channel for Log messages.
Listen() <-chan Log
// Close closes the logger. No more messages will be logged.
Close()
}
Logger is for logging debug messages.
type PubSub ¶
type PubSub interface {
// Publish accepts a SRT connection where it reads from. It blocks
// until the connection closes. The returned error indicates why it
// stopped. There can be only one publisher.
Publish(c Conn) error
// Subscribe accepts a SRT connection where it writes the data from
// the publisher to. It blocks until an error happens. If the publisher
// disconnects, io.EOF is returned. There can be an arbitrary number
// of subscribers.
Subscribe(c Conn) error
}
PubSub is a publish/subscriber service for SRT connections.
func NewPubSub ¶
func NewPubSub(config PubSubConfig) PubSub
NewPubSub returns a PubSub. After the publishing connection closed this PubSub can't be used anymore.
type PubSubConfig ¶
type PubSubConfig struct {
Logger Logger // Optional logger
}
PubSubConfig is for configuring a new PubSub
type RejectionReason ¶ added in v0.5.6
type RejectionReason uint32
RejectionReason are the rejection reasons that can be returned from the AcceptFunc in order to send another reason than the default one (REJ_PEER) to the client.
const ( REJ_UNKNOWN RejectionReason = 1000 // unknown reason REJ_SYSTEM RejectionReason = 1001 // system function error REJ_PEER RejectionReason = 1002 // rejected by peer REJ_RESOURCE RejectionReason = 1003 // resource allocation problem REJ_ROGUE RejectionReason = 1004 // incorrect data in handshake REJ_BACKLOG RejectionReason = 1005 // listener's backlog exceeded REJ_IPE RejectionReason = 1006 // internal program error REJ_CLOSE RejectionReason = 1007 // socket is closing REJ_VERSION RejectionReason = 1008 // peer is older version than agent's min REJ_RDVCOOKIE RejectionReason = 1009 // rendezvous cookie collision REJ_BADSECRET RejectionReason = 1010 // wrong password REJ_UNSECURE RejectionReason = 1011 // password required or unexpected REJ_MESSAGEAPI RejectionReason = 1012 // stream flag collision REJ_CONGESTION RejectionReason = 1013 // incompatible congestion-controller type REJ_FILTER RejectionReason = 1014 // incompatible packet filter REJ_GROUP RejectionReason = 1015 // incompatible group )
Table 7: Handshake Rejection Reason Codes
const ( REJX_BAD_REQUEST RejectionReason = 1400 // General syntax error in the SocketID specification (also a fallback code for undefined cases) REJX_UNAUTHORIZED RejectionReason = 1401 // Authentication failed, provided that the user was correctly identified and access to the required resource would be granted REJX_OVERLOAD RejectionReason = 1402 // The server is too heavily loaded, or you have exceeded credits for accessing the service and the resource. REJX_FORBIDDEN RejectionReason = 1403 // Access denied to the resource by any kind of reason. REJX_NOTFOUND RejectionReason = 1404 // Resource not found at this time. REJX_BAD_MODE RejectionReason = 1405 // The mode specified in `m` key in StreamID is not supported for this request. REJX_UNACCEPTABLE RejectionReason = 1406 // The requested parameters specified in SocketID cannot be satisfied for the requested resource. Also when m=publish and the data format is not acceptable. REJX_CONFLICT RejectionReason = 1407 // The resource being accessed is already locked for modification. This is in case of m=publish and the specified resource is currently read-only. REJX_NOTSUP_MEDIA RejectionReason = 1415 // The media type is not supported by the application. This is the `t` key that specifies the media type as stream, file and auth, possibly extended by the application. REJX_LOCKED RejectionReason = 1423 // The resource being accessed is locked for any access. REJX_FAILED_DEPEND RejectionReason = 1424 // The request failed because it specified a dependent session ID that has been disconnected. REJX_ISE RejectionReason = 1500 // Unexpected internal server error REJX_UNIMPLEMENTED RejectionReason = 1501 // The request was recognized, but the current version doesn't support it. REJX_GW RejectionReason = 1502 // The server acts as a gateway and the target endpoint rejected the connection. REJX_DOWN RejectionReason = 1503 // The service has been temporarily taken over by a stub reporting this error. The real service can be down for maintenance or crashed. REJX_VERSION RejectionReason = 1505 // SRT version not supported. This might be either unsupported backward compatibility, or an upper value of a version. REJX_NOROOM RejectionReason = 1507 // The data stream cannot be archived due to lacking storage space. This is in case when the request type was to send a file or the live stream to be archived. )
These are the extended rejection reasons that may be less well supported Codes & their meanings taken from https://github.com/Haivision/srt/blob/f477af533562505abf5295f059cf2156b17be740/srtcore/access_control.h
type Server ¶
type Server struct {
// The address the SRT server should listen on, e.g. ":6001".
Addr string
// Config is the configuration for a SRT listener.
Config *Config
// HandleConnect will be called for each incoming connection. This
// allows you to implement your own interpretation of the streamid
// and authorization. If this is nil, all connections will be
// rejected.
HandleConnect AcceptFunc
// HandlePublish will be called for a publishing connection.
HandlePublish func(conn Conn)
// HandlePublish will be called for a subscribing connection.
HandleSubscribe func(conn Conn)
// contains filtered or unexported fields
}
Server is a framework for a SRT server
func (*Server) Listen ¶ added in v0.5.4
Listen opens the server listener. It returns immediately after the listener is ready.
func (*Server) ListenAndServe ¶
ListenAndServe starts the SRT server. It blocks until an error happens. If the error is ErrServerClosed the server has shutdown normally.
type Statistics ¶
type Statistics struct {
MsTimeStamp uint64 // The time elapsed, in milliseconds, since the SRT socket has been created
// Accumulated
Accumulated StatisticsAccumulated
// Interval
Interval StatisticsInterval
// Instantaneous
Instantaneous StatisticsInstantaneous
}
Statistics represents the statistics for a connection
type StatisticsAccumulated ¶ added in v0.3.0
type StatisticsAccumulated struct {
PktSent uint64 // The total number of sent DATA packets, including retransmitted packets
PktRecv uint64 // The total number of received DATA packets, including retransmitted packets
PktSentUnique uint64 // The total number of unique DATA packets sent by the SRT sender
PktRecvUnique uint64 // The total number of unique original, retransmitted or recovered by the packet filter DATA packets received in time, decrypted without errors and, as a result, scheduled for delivery to the upstream application by the SRT receiver.
PktSendLoss uint64 // The total number of data packets considered or reported as lost at the sender side. Does not correspond to the packets detected as lost at the receiver side.
PktRecvLoss uint64 // The total number of SRT DATA packets detected as presently missing (either reordered or lost) at the receiver side
PktRetrans uint64 // The total number of retransmitted packets sent by the SRT sender
PktRecvRetrans uint64 // The total number of retransmitted packets registered at the receiver side
PktSentACK uint64 // The total number of sent ACK (Acknowledgement) control packets
PktRecvACK uint64 // The total number of received ACK (Acknowledgement) control packets
PktSentNAK uint64 // The total number of sent NAK (Negative Acknowledgement) control packets
PktRecvNAK uint64 // The total number of received NAK (Negative Acknowledgement) control packets
PktSentKM uint64 // The total number of sent KM (Key Material) control packets
PktRecvKM uint64 // The total number of received KM (Key Material) control packets
UsSndDuration uint64 // The total accumulated time in microseconds, during which the SRT sender has some data to transmit, including packets that have been sent, but not yet acknowledged
PktRecvBelated uint64
PktSendDrop uint64 // The total number of dropped by the SRT sender DATA packets that have no chance to be delivered in time
PktRecvDrop uint64 // The total number of dropped by the SRT receiver and, as a result, not delivered to the upstream application DATA packets
PktRecvUndecrypt uint64 // The total number of packets that failed to be decrypted at the receiver side
ByteSent uint64 // Same as pktSent, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecv uint64 // Same as pktRecv, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteSentUnique uint64 // Same as pktSentUnique, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecvUnique uint64 // Same as pktRecvUnique, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecvLoss uint64 // Same as pktRecvLoss, but expressed in bytes, including payload and all the headers (IP, TCP, SRT), bytes for the presently missing (either reordered or lost) packets' payloads are estimated based on the average packet size
ByteRetrans uint64 // Same as pktRetrans, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecvRetrans uint64 // Same as pktRecvRetrans, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecvBelated uint64
ByteSendDrop uint64 // Same as pktSendDrop, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecvDrop uint64 // Same as pktRecvDrop, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecvUndecrypt uint64 // Same as pktRecvUndecrypt, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
}
type StatisticsInstantaneous ¶ added in v0.3.0
type StatisticsInstantaneous struct {
UsPktSendPeriod float64 // Current minimum time interval between which consecutive packets are sent, in microseconds
PktFlowWindow uint64 // The maximum number of packets that can be "in flight"
PktFlightSize uint64 // The number of packets in flight
MsRTT float64 // Smoothed round-trip time (SRTT), an exponentially-weighted moving average (EWMA) of an endpoint's RTT samples, in milliseconds
MbpsSentRate float64 // Current transmission bandwidth, in Mbps
MbpsRecvRate float64 // Current receiving bandwidth, in Mbps
MbpsLinkCapacity float64 // Estimated capacity of the network link, in Mbps
ByteAvailSendBuf uint64 // The available space in the sender's buffer, in bytes
ByteAvailRecvBuf uint64 // The available space in the receiver's buffer, in bytes
MbpsMaxBW float64 // Transmission bandwidth limit, in Mbps
ByteMSS uint64 // Maximum Segment Size (MSS), in bytes
PktSendBuf uint64 // The number of packets in the sender's buffer that are already scheduled for sending or even possibly sent, but not yet acknowledged
ByteSendBuf uint64 // Instantaneous (current) value of pktSndBuf, but expressed in bytes, including payload and all headers (IP, TCP, SRT)
MsSendBuf uint64 // The timespan (msec) of packets in the sender's buffer (unacknowledged packets)
MsSendTsbPdDelay uint64 // Timestamp-based Packet Delivery Delay value of the peer
PktRecvBuf uint64 // The number of acknowledged packets in receiver's buffer
ByteRecvBuf uint64 // Instantaneous (current) value of pktRcvBuf, expressed in bytes, including payload and all headers (IP, TCP, SRT)
MsRecvBuf uint64 // The timespan (msec) of acknowledged packets in the receiver's buffer
MsRecvTsbPdDelay uint64 // Timestamp-based Packet Delivery Delay value set on the socket via SRTO_RCVLATENCY or SRTO_LATENCY
PktReorderTolerance uint64 // Instant value of the packet reorder tolerance
PktRecvAvgBelatedTime uint64 // Accumulated difference between the current time and the time-to-play of a packet that is received late
PktSendLossRate float64 // Percentage of resent data vs. sent data
PktRecvLossRate float64 // Percentage of retransmitted data vs. received data
}
type StatisticsInterval ¶ added in v0.3.0
type StatisticsInterval struct {
MsInterval uint64 // Length of the interval, in milliseconds
PktSent uint64 // Number of sent DATA packets, including retransmitted packets
PktRecv uint64 // Number of received DATA packets, including retransmitted packets
PktSentUnique uint64 // Number of unique DATA packets sent by the SRT sender
PktRecvUnique uint64 // Number of unique original, retransmitted or recovered by the packet filter DATA packets received in time, decrypted without errors and, as a result, scheduled for delivery to the upstream application by the SRT receiver.
PktSendLoss uint64 // Number of data packets considered or reported as lost at the sender side. Does not correspond to the packets detected as lost at the receiver side.
PktRecvLoss uint64 // Number of SRT DATA packets detected as presently missing (either reordered or lost) at the receiver side
PktRetrans uint64 // Number of retransmitted packets sent by the SRT sender
PktRecvRetrans uint64 // Number of retransmitted packets registered at the receiver side
PktSentACK uint64 // Number of sent ACK (Acknowledgement) control packets
PktRecvACK uint64 // Number of received ACK (Acknowledgement) control packets
PktSentNAK uint64 // Number of sent NAK (Negative Acknowledgement) control packets
PktRecvNAK uint64 // Number of received NAK (Negative Acknowledgement) control packets
MbpsSendRate float64 // Sending rate, in Mbps
MbpsRecvRate float64 // Receiving rate, in Mbps
UsSndDuration uint64 // Accumulated time in microseconds, during which the SRT sender has some data to transmit, including packets that have been sent, but not yet acknowledged
PktReorderDistance uint64
PktRecvBelated uint64 // Number of packets that arrive too late
PktSndDrop uint64 // Number of dropped by the SRT sender DATA packets that have no chance to be delivered in time
PktRecvDrop uint64 // Number of dropped by the SRT receiver and, as a result, not delivered to the upstream application DATA packets
PktRecvUndecrypt uint64 // Number of packets that failed to be decrypted at the receiver side
ByteSent uint64 // Same as pktSent, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecv uint64 // Same as pktRecv, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteSentUnique uint64 // Same as pktSentUnique, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecvUnique uint64 // Same as pktRecvUnique, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecvLoss uint64 // Same as pktRecvLoss, but expressed in bytes, including payload and all the headers (IP, TCP, SRT), bytes for the presently missing (either reordered or lost) packets' payloads are estimated based on the average packet size
ByteRetrans uint64 // Same as pktRetrans, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecvRetrans uint64 // Same as pktRecvRetrans, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecvBelated uint64 // Same as pktRecvBelated, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteSendDrop uint64 // Same as pktSendDrop, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecvDrop uint64 // Same as pktRecvDrop, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
ByteRecvUndecrypt uint64 // Same as pktRecvUndecrypt, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package circular implements "circular numbers".
|
Package circular implements "circular numbers". |
|
Package congestions provides interfaces and types congestion control implementations for SRT
|
Package congestions provides interfaces and types congestion control implementations for SRT |
|
live
Package live provides implementations of the Sender and Receiver interfaces for live congestion control
|
Package live provides implementations of the Sender and Receiver interfaces for live congestion control |
|
contrib
|
|
|
client
command
|
|
|
server
command
|
|
|
Package crypto provides SRT cryptography
|
Package crypto provides SRT cryptography |
|
Package packet provides types and implementations for the different SRT packet types
|
Package packet provides types and implementations for the different SRT packet types |