mirror of https://bitbucket.org/ausocean/av.git
Don't fail if Close() returns an error, since it just means there is no connection, and don't call Close when Dial fails.
This commit is contained in:
parent
36182d7e6d
commit
c15c57f15f
|
@ -307,17 +307,13 @@ func (s *rtmpSender) release() {
|
|||
}
|
||||
|
||||
func (s *rtmpSender) restart() error {
|
||||
err := s.conn.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.conn.Close()
|
||||
for n := 0; n < s.retries; n++ {
|
||||
s.conn, err = rtmp.Dial(s.url, s.timeout, s.log)
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
s.log(logger.Error, err.Error())
|
||||
s.conn.Close()
|
||||
if n < s.retries-1 {
|
||||
s.log(logger.Info, pkg+"retry rtmp connection")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue