Documentation ¶
Index ¶
- Constants
- Variables
- func CleanupSRT()
- func CreateAddrInet(name string, port uint16) (*C.struct_sockaddr, int, error)
- func InitSRT()
- type SrtSocket
- func (s SrtSocket) Accept() (*SrtSocket, *net.UDPAddr, error)
- func (s SrtSocket) Close()
- func (s SrtSocket) Connect() error
- func (s SrtSocket) GetSockOptBool(opt int) (bool, error)
- func (s SrtSocket) GetSockOptByte(opt int) (byte, error)
- func (s SrtSocket) GetSockOptInt(opt int) (int, error)
- func (s SrtSocket) GetSockOptInt64(opt int) (int64, error)
- func (s SrtSocket) GetSockOptString(opt int) (string, error)
- func (s SrtSocket) GetSocket() C.int
- func (s SrtSocket) InstantStats(clear bool) (*SrtStats, error)
- func (s SrtSocket) Listen(clients int) error
- func (s SrtSocket) Mode() int
- func (s SrtSocket) PacketSize() int
- func (s SrtSocket) Read(b []byte, timeout int) (n int, err error)
- func (s SrtSocket) SetSockOptBool(opt int, value bool) error
- func (s SrtSocket) SetSockOptByte(opt int, value byte) error
- func (s SrtSocket) SetSockOptInt(opt int, value int) error
- func (s SrtSocket) SetSockOptInt64(opt int, value int64) error
- func (s SrtSocket) SetSockOptString(opt int, value string) error
- func (s SrtSocket) Stats(clear bool) (*SrtStats, error)
- func (s SrtSocket) Write(b []byte, timeout int) (n int, err error)
- type SrtStats
Constants ¶
const ( ModeFailure = iota ModeListener ModeCaller ModeRendezvouz )
SRT Socket mode
const ( SRTO_TRANSTYPE = C.SRTO_TRANSTYPE SRTO_MAXBW = C.SRTO_MAXBW SRTO_PBKEYLEN = C.SRTO_PBKEYLEN SRTO_PASSPHRASE = C.SRTO_PASSPHRASE SRTO_MSS = C.SRTO_MSS SRTO_FC = C.SRTO_FC SRTO_SNDBUF = C.SRTO_SNDBUF SRTO_RCVBUF = C.SRTO_RCVBUF SRTO_IPTTL = C.SRTO_IPTTL SRTO_IPTOS = C.SRTO_IPTOS SRTO_INPUTBW = C.SRTO_INPUTBW SRTO_OHEADBW = C.SRTO_OHEADBW SRTO_LATENCY = C.SRTO_LATENCY SRTO_TSBPDMODE = C.SRTO_TSBPDMODE SRTO_TLPKTDROP = C.SRTO_TLPKTDROP SRTO_SNDDROPDELAY = C.SRTO_SNDDROPDELAY SRTO_NAKREPORT = C.SRTO_NAKREPORT SRTO_CONNTIMEO = C.SRTO_CONNTIMEO SRTO_LOSSMAXTTL = C.SRTO_LOSSMAXTTL SRTO_RCVLATENCY = C.SRTO_RCVLATENCY SRTO_PEERLATENCY = C.SRTO_PEERLATENCY SRTO_MINVERSION = C.SRTO_MINVERSION SRTO_STREAMID = C.SRTO_STREAMID SRTO_CONGESTION = C.SRTO_CONGESTION SRTO_MESSAGEAPI = C.SRTO_MESSAGEAPI SRTO_PAYLOADSIZE = C.SRTO_PAYLOADSIZE SRTO_KMREFRESHRATE = C.SRTO_KMREFRESHRATE SRTO_KMPREANNOUNCE = C.SRTO_KMPREANNOUNCE SRTO_ENFORCEDENCRYPTION = C.SRTO_ENFORCEDENCRYPTION SRTO_PEERIDLETIMEO = C.SRTO_PEERIDLETIMEO SRTO_PACKETFILTER = C.SRTO_PACKETFILTER SRTO_STATE = C.SRTO_STATE )
Variables ¶
var ( SRT_INVALID_SOCK = C.get_srt_invalid_sock() SRT_ERROR = C.get_srt_error() SRT_REJX_FORBIDDEN = C.get_srt_error_access_forbidden() SRTS_CONNECTED = C.SRTS_CONNECTED )
Static consts from library
var SocketOptions = []socketOption{ {"transtype", 0, SRTO_TRANSTYPE, bindingPre, tTransType}, {"maxbw", 0, SRTO_MAXBW, bindingPre, tInteger64}, {"pbkeylen", 0, SRTO_PBKEYLEN, bindingPre, tInteger32}, {"passphrase", 0, SRTO_PASSPHRASE, bindingPre, tString}, {"mss", 0, SRTO_MSS, bindingPre, tInteger32}, {"fc", 0, SRTO_FC, bindingPre, tInteger32}, {"sndbuf", 0, SRTO_SNDBUF, bindingPre, tInteger32}, {"rcvbuf", 0, SRTO_RCVBUF, bindingPre, tInteger32}, {"ipttl", 0, SRTO_IPTTL, bindingPre, tInteger32}, {"iptos", 0, SRTO_IPTOS, bindingPre, tInteger32}, {"inputbw", 0, SRTO_INPUTBW, bindingPost, tInteger64}, {"oheadbw", 0, SRTO_OHEADBW, bindingPost, tInteger32}, {"latency", 0, SRTO_LATENCY, bindingPre, tInteger32}, {"tsbpdmode", 0, SRTO_TSBPDMODE, bindingPre, tBoolean}, {"tlpktdrop", 0, SRTO_TLPKTDROP, bindingPre, tBoolean}, {"snddropdelay", 0, SRTO_SNDDROPDELAY, bindingPost, tInteger32}, {"nakreport", 0, SRTO_NAKREPORT, bindingPre, tBoolean}, {"conntimeo", 0, SRTO_CONNTIMEO, bindingPre, tInteger32}, {"lossmaxttl", 0, SRTO_LOSSMAXTTL, bindingPre, tInteger32}, {"rcvlatency", 0, SRTO_RCVLATENCY, bindingPre, tInteger32}, {"peerlatency", 0, SRTO_PEERLATENCY, bindingPre, tInteger32}, {"minversion", 0, SRTO_MINVERSION, bindingPre, tInteger32}, {"streamid", 0, SRTO_STREAMID, bindingPre, tString}, {"congestion", 0, SRTO_CONGESTION, bindingPre, tString}, {"messageapi", 0, SRTO_MESSAGEAPI, bindingPre, tBoolean}, {"payloadsize", 0, SRTO_PAYLOADSIZE, bindingPre, tInteger32}, {"kmrefreshrate", 0, SRTO_KMREFRESHRATE, bindingPre, tInteger32}, {"kmpreannounce", 0, SRTO_KMPREANNOUNCE, bindingPre, tInteger32}, {"enforcedencryption", 0, SRTO_ENFORCEDENCRYPTION, bindingPre, tBoolean}, {"peeridletimeo", 0, SRTO_PEERIDLETIMEO, bindingPre, tInteger32}, {"packetfilter", 0, SRTO_PACKETFILTER, bindingPre, tString}, }
List of possible srt socket options
Functions ¶
func CreateAddrInet ¶
Types ¶
type SrtSocket ¶
type SrtSocket struct {
// contains filtered or unexported fields
}
SrtSocket - SRT socket
func NewSrtSocket ¶
NewSrtSocket - Create a new SRT Socket
func (SrtSocket) GetSockOptBool ¶
GetSockOptBool - return bool value obtained with srt_getsockopt
func (SrtSocket) GetSockOptByte ¶
GetSockOptByte - return byte value obtained with srt_getsockopt
func (SrtSocket) GetSockOptInt ¶
GetSockOptInt - return int value obtained with srt_getsockopt
func (SrtSocket) GetSockOptInt64 ¶
GetSockOptInt64 - return int64 value obtained with srt_getsockopt
func (SrtSocket) GetSockOptString ¶
GetSockOptString - return string value obtained with srt_getsockopt
func (SrtSocket) InstantStats ¶
Stats - Retrieve stats from the SRT socket
func (SrtSocket) PacketSize ¶
PacketSize - Return packet size of the SRT socket
func (SrtSocket) SetSockOptBool ¶
SetSockOptBool - set bool value using srt_setsockopt
func (SrtSocket) SetSockOptByte ¶
SetSockOptByte - set byte value using srt_setsockopt
func (SrtSocket) SetSockOptInt ¶
SetSockOptInt - set int value using srt_setsockopt
func (SrtSocket) SetSockOptInt64 ¶
SetSockOptInt64 - set int64 value using srt_setsockopt
func (SrtSocket) SetSockOptString ¶
SetSockOptString - set string value using srt_setsockopt
type SrtStats ¶
type SrtStats struct { // Global measurements MsTimeStamp int64 // time since the UDT entity is started, in milliseconds PktSentTotal int64 // total number of sent data packets, including retransmissions PktRecvTotal int64 // total number of received packets PktSndLossTotal int // total number of lost packets (sender side) PktRcvLossTotal int // total number of lost packets (receiver side) PktRetransTotal int // total number of retransmitted packets PktSentACKTotal int // total number of sent ACK packets PktRecvACKTotal int // total number of received ACK packets PktSentNAKTotal int // total number of sent NAK packets PktRecvNAKTotal int // total number of received NAK packets UsSndDurationTotal int64 // total time duration when UDT is sending data (idle time exclusive) PktSndDropTotal int // number of too-late-to-send dropped packets PktRcvDropTotal int // number of too-late-to play missing packets PktRcvUndecryptTotal int // number of undecrypted packets ByteSentTotal int64 // total number of sent data bytes, including retransmissions ByteRecvTotal int64 // total number of received bytes ByteRcvLossTotal int64 // total number of lost bytes ByteRetransTotal int64 // total number of retransmitted bytes ByteSndDropTotal int64 // number of too-late-to-send dropped bytes ByteRcvDropTotal int64 // number of too-late-to play missing bytes (estimate based on average packet size) ByteRcvUndecryptTotal int64 // number of undecrypted bytes // Local measurements PktSent int64 // number of sent data packets, including retransmissions PktRecv int64 // number of received packets PktSndLoss int // number of lost packets (sender side) PktRcvLoss int // number of lost packets (receiver side) PktRetrans int // number of retransmitted packets PktRcvRetrans int // number of retransmitted packets received PktSentACK int // number of sent ACK packets PktRecvACK int // number of received ACK packets PktSentNAK int // number of sent NAK packets PktRecvNAK int // number of received NAK packets MbpsSendRate float64 // sending rate in Mb/s MbpsRecvRate float64 // receiving rate in Mb/s UsSndDuration int64 // busy sending time (i.e., idle time exclusive) PktReorderDistance int // size of order discrepancy in received sequences PktRcvAvgBelatedTime float64 // average time of packet delay for belated packets (packets with sequence past the ACK) PktRcvBelated int64 // number of received AND IGNORED packets due to having come too late PktSndDrop int // number of too-late-to-send dropped packets PktRcvDrop int // number of too-late-to play missing packets PktRcvUndecrypt int // number of undecrypted packets ByteSent int64 // number of sent data bytes, including retransmissions ByteRecv int64 // number of received bytes ByteRcvLoss int64 // number of retransmitted Bytes ByteRetrans int64 // number of retransmitted Bytes ByteSndDrop int64 // number of too-late-to-send dropped Bytes ByteRcvDrop int64 // number of too-late-to play missing Bytes (estimate based on average packet size) ByteRcvUndecrypt int64 // number of undecrypted bytes // Instant measurements UsPktSndPeriod float64 // packet sending period, in microseconds PktFlowWindow int // flow window size, in number of packets PktCongestionWindow int // congestion window size, in number of packets PktFlightSize int // number of packets on flight MsRTT float64 // RTT, in milliseconds MbpsBandwidth float64 // estimated bandwidth, in Mb/s ByteAvailSndBuf int // available UDT sender buffer size ByteAvailRcvBuf int // available UDT receiver buffer size MbpsMaxBW float64 // Transmit Bandwidth ceiling (Mbps) ByteMSS int // MTU PktSndBuf int // UnACKed packets in UDT sender ByteSndBuf int // UnACKed bytes in UDT sender MsSndBuf int // UnACKed timespan (msec) of UDT sender MsSndTsbPdDelay int // Timestamp-based Packet Delivery Delay PktRcvBuf int // Undelivered packets in UDT receiver ByteRcvBuf int // Undelivered bytes of UDT receiver MsRcvBuf int // Undelivered timespan (msec) of UDT receiver MsRcvTsbPdDelay int // Timestamp-based Packet Delivery Delay PktSndFilterExtraTotal int // number of control packets supplied by packet filter PktRcvFilterExtraTotal int // number of control packets received and not supplied back PktRcvFilterSupplyTotal int // number of packets that the filter supplied extra (e.g. FEC rebuilt) PktRcvFilterLossTotal int // number of packet loss not coverable by filter PktSndFilterExtra int // number of control packets supplied by packet filter PktRcvFilterExtra int // number of control packets received and not supplied back PktRcvFilterSupply int // number of packets that the filter supplied extra (e.g. FEC rebuilt) PktRcvFilterLoss int // number of packet loss not coverable by filter PktReorderTolerance int // packet reorder tolerance value }