add ClientConf.OnRequest, ClientConf.OnResponse

This commit is contained in:
aler9
2020-12-08 11:54:38 +01:00
parent eb7ebc5543
commit 07aefbcd5d
8 changed files with 45 additions and 31 deletions

View File

@@ -164,7 +164,7 @@ func (c *ClientConn) backgroundRecordTCP() {
for trackID := range c.rtcpSenders {
r := c.rtcpSenders[trackID].Report(now)
if r != nil {
c.nconn.SetWriteDeadline(time.Now().Add(c.c.WriteTimeout))
c.nconn.SetWriteDeadline(time.Now().Add(c.conf.WriteTimeout))
frame := base.InterleavedFrame{
TrackID: trackID,
StreamType: StreamTypeRtcp,
@@ -199,7 +199,7 @@ func (c *ClientConn) WriteFrame(trackID int, streamType StreamType, content []by
return c.udpRtcpListeners[trackID].write(content)
}
c.nconn.SetWriteDeadline(now.Add(c.c.WriteTimeout))
c.nconn.SetWriteDeadline(now.Add(c.conf.WriteTimeout))
frame := base.InterleavedFrame{
TrackID: trackID,
StreamType: streamType,