RTMP client: fix timeout when publishing
This commit is contained in:
parent
28de7aefa2
commit
71c333177f
|
@ -169,7 +169,8 @@ func (c *Client) run() {
|
|||
defer onConnectCmd.Close()
|
||||
}
|
||||
|
||||
c.conn.NetConn().SetDeadline(time.Now().Add(c.readTimeout))
|
||||
c.conn.NetConn().SetReadDeadline(time.Now().Add(c.readTimeout))
|
||||
c.conn.NetConn().SetWriteDeadline(time.Now().Add(c.writeTimeout))
|
||||
err := c.conn.ServerHandshake()
|
||||
if err != nil {
|
||||
c.log(logger.Info, "ERR: %s", err)
|
||||
|
@ -303,6 +304,9 @@ func (c *Client) runRead() {
|
|||
return
|
||||
}
|
||||
|
||||
// disable read deadline
|
||||
c.conn.NetConn().SetReadDeadline(time.Time{})
|
||||
|
||||
writerDone := make(chan error)
|
||||
go func() {
|
||||
writerDone <- func() error {
|
||||
|
@ -471,6 +475,9 @@ func (c *Client) runPublish() {
|
|||
return
|
||||
}
|
||||
|
||||
// disable write deadline
|
||||
c.conn.NetConn().SetWriteDeadline(time.Time{})
|
||||
|
||||
readerDone := make(chan error)
|
||||
go func() {
|
||||
readerDone <- func() error {
|
||||
|
|
Loading…
Reference in New Issue