rtmp: rename StartSession to Open

This commit is contained in:
Dan Kortschak 2018-06-17 20:45:48 +09:30
parent 05c6c376b4
commit 5bdd66e22b
2 changed files with 5 additions and 5 deletions

View File

@ -223,7 +223,7 @@ func newRtmpSender(url string, timeout uint, retries int, log func(lvl, msg stri
var err error
for n := 0; n < retries; n++ {
sess = rtmp.NewSession(url, timeout)
err = sess.StartSession()
err = sess.Open()
if err == nil {
break
}
@ -269,7 +269,7 @@ func (s *rtmpSender) restart() error {
}
for n := 0; n < s.retries; n++ {
s.sess = rtmp.NewSession(s.url, s.timeout)
err = s.sess.StartSession()
err = s.sess.Open()
if err == nil {
break
}

View File

@ -48,7 +48,7 @@ import (
// Session provides an interface for sending flv tags over rtmp.
type Session interface {
StartSession() error
Open() error
Write([]byte) (int, error)
Close() error
}
@ -71,9 +71,9 @@ func NewSession(url string, connectTimeout uint) Session {
}
}
// StartSession establishes an rtmp connection with the url passed into the
// Open establishes an rtmp connection with the url passed into the
// constructor
func (s *session) StartSession() error {
func (s *session) Open() error {
if s.rtmp != nil {
return errors.New("rtmp: attempt to start already running session")
}