mirror of https://bitbucket.org/ausocean/av.git
protocol/rtcp: fixed bug regarding checking of close err channel from client in routines.
This commit is contained in:
parent
d29141cf05
commit
fbcd163864
|
@ -132,8 +132,8 @@ func (c *Client) Stop() {
|
|||
c.log(logger.Debug, pkg+"Client is stopping")
|
||||
close(c.quit)
|
||||
c.conn.Close()
|
||||
close(c.err)
|
||||
c.wg.Wait()
|
||||
close(c.err)
|
||||
}
|
||||
|
||||
// Err provides read access to the Client err channel. This must be checked
|
||||
|
|
|
@ -166,14 +166,14 @@ func TestReceiveAndSend(t *testing.T) {
|
|||
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case err := <-c.Err():
|
||||
err, ok := <-c.Err()
|
||||
if ok {
|
||||
const errConnClosed = "use of closed network connection"
|
||||
if !strings.Contains(err.Error(), errConnClosed) {
|
||||
t.Fatalf("error received from client error chan: %v\n", err)
|
||||
}
|
||||
|
||||
default:
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Reference in New Issue