1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00
srs/trunk/3rdparty/srs-bench/vendor/github.com/haivision/srtgo
Winlin 1f9309ae25
SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097)
1. Add live benchmark support in srs-bench, which only connects and
disconnects without any media transport, to test source creation and
disposal and verify source memory leaks.
2. SmartPtr: Support cleanup of HTTP-FLV stream. Unregister the HTTP-FLV
handler for the pattern and clean up the objects and resources.
3. Support benchmarking RTMP/SRT with srs-bench by integrating the gosrt
and oryx RTMP libraries.
4. Refine SRT and RTC sources by using a timer to clean up the sources,
following the same strategy as the Live source.

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-06-21 07:13:12 +08:00
..
accept.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
callback.h SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
callback_c.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
errors.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
LICENSE SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
logging.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
logging_c.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
netutils.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
netutils_unix.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
netutils_windows.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
poll.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
pollserver.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
read.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
README.md SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
srtgo.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
srtsocketoptions.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
srtstats.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00
write.go SmartPtr: Support load test for source by srs-bench. v6.0.130 (#4097) 2024-06-21 07:13:12 +08:00

PkgGoDev

srtgo

Go bindings for SRT (Secure Reliable Transport), the open source transport technology that optimizes streaming performance across unpredictable networks.

Why srtgo?

The purpose of srtgo is easing the adoption of SRT transport technology. Using Go, with just a few lines of code you can implement an application that sends/receives data with all the benefits of SRT technology: security and reliability, while keeping latency low.

Is this a new implementation of SRT?

No! We are just exposing the great work done by the community in the SRT project as a golang library. All the functionality and implementation still resides in the official SRT project.

Features supported

  • Basic API exposed to easy develop SRT sender/receiver apps
  • Caller and Listener mode
  • Live transport type
  • File transport type
  • Message/Buffer API
  • SRT transport options up to SRT 1.4.1
  • SRT Stats retrieval

Usage

Example of a SRT receiver application:

package main

import (
    "github.com/haivision/srtgo"
    "fmt"
)

func main() {
    options := make(map[string]string)
    options["transtype"] = "file"

    sck := srtgo.NewSrtSocket("0.0.0.0", 8090, options)
    defer sck.Close()
    sck.Listen(1)
    s, _ := sck.Accept()
    defer s.Close()

    buf := make([]byte, 2048)
    for {
        n, _ := s.Read(buf)
        if n == 0 {
            break
        }
        fmt.Println("Received %d bytes", n)
    }
    //....
}

Dependencies

  • srtlib

You can find detailed instructions about how to install srtlib in its README file

gosrt has been developed with srt 1.4.1 as its main target and has been successfully tested in srt 1.3.4 and above.