protocol/rtcp/client.go: initialise error chan err in constructor rather than Client.Start() function

This commit is contained in:
Saxon 2019-10-15 16:59:52 +10:30
parent 8163a956a9
commit 5995f1a815
2 changed files with 2 additions and 2 deletions

2
go.mod
View File

@ -3,8 +3,8 @@ module bitbucket.org/ausocean/av
go 1.13 go 1.13
require ( require (
bitbuket.org/ausocean/test latest
bitbucket.org/ausocean/iot v1.2.7 bitbucket.org/ausocean/iot v1.2.7
bitbucket.org/ausocean/test v0.0.0-20190821085226-7a524f2344ba
bitbucket.org/ausocean/utils v1.2.9 bitbucket.org/ausocean/utils v1.2.9
github.com/BurntSushi/toml v0.3.1 // indirect github.com/BurntSushi/toml v0.3.1 // indirect
github.com/Comcast/gots v0.0.0-20190305015453-8d56e473f0f7 github.com/Comcast/gots v0.0.0-20190305015453-8d56e473f0f7

View File

@ -81,6 +81,7 @@ func NewClient(clientAddress, serverAddress string, rtpClt *rtp.Client, l Log) (
c := &Client{ c := &Client{
name: defaultClientName, name: defaultClientName,
quit: make(chan struct{}), quit: make(chan struct{}),
err: make(chan error),
interval: defaultSendInterval, interval: defaultSendInterval,
rtpClt: rtpClt, rtpClt: rtpClt,
log: l, log: l,
@ -120,7 +121,6 @@ func (c *Client) SetName(name string) {
// reports to the server. // reports to the server.
func (c *Client) Start() { func (c *Client) Start() {
c.log(logger.Debug, pkg+"Client is starting") c.log(logger.Debug, pkg+"Client is starting")
c.err = make(chan error)
c.wg.Add(2) c.wg.Add(2)
go c.recv() go c.recv()
go c.send() go c.send()