|
|
|
@ -12,10 +12,6 @@ import ( |
|
|
|
"github.com/aler9/rtsp-simple-server/internal/logger" |
|
|
|
"github.com/aler9/rtsp-simple-server/internal/logger" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
|
|
|
|
port = 9999 |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Parent is implemented by program.
|
|
|
|
// Parent is implemented by program.
|
|
|
|
type Parent interface { |
|
|
|
type Parent interface { |
|
|
|
Log(logger.Level, string, ...interface{}) |
|
|
|
Log(logger.Level, string, ...interface{}) |
|
|
|
@ -30,9 +26,10 @@ type Pprof struct { |
|
|
|
// New allocates a Pprof.
|
|
|
|
// New allocates a Pprof.
|
|
|
|
func New( |
|
|
|
func New( |
|
|
|
listenIP string, |
|
|
|
listenIP string, |
|
|
|
|
|
|
|
port int, |
|
|
|
parent Parent, |
|
|
|
parent Parent, |
|
|
|
) (*Pprof, error) { |
|
|
|
) (*Pprof, error) { |
|
|
|
address := listenIP + ":" + strconv.FormatInt(port, 10) |
|
|
|
address := listenIP + ":" + strconv.FormatInt(int64(port), 10) |
|
|
|
listener, err := net.Listen("tcp", address) |
|
|
|
listener, err := net.Listen("tcp", address) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
|