diff --git a/client.go b/client.go index dbdf7a5..0c9fe2b 100644 --- a/client.go +++ b/client.go @@ -30,8 +30,8 @@ type Client struct { // IdChannel is a channel that publishes this client's PeerId as it first // becomes available and changes on subsequent reconnects. A channel is used // here because the PeerId changes with each reconnect. - IdChannel <-chan PeerId - idChannel chan PeerId + UpdatedIdsCh <-chan PeerId + updatedIdsCh chan PeerId connInfoChs chan chan *connInfo connErrCh chan error @@ -53,8 +53,8 @@ type DialFunc func() (net.Conn, error) // Note - whether or not auto reconnecting is enabled, this method doesn't // return until a connection has been established or we've failed trying. func (c *Client) Connect() (PeerId, error) { - c.idChannel = make(chan PeerId, 100) - c.IdChannel = c.idChannel + c.updatedIdsCh = make(chan PeerId, 100) + c.UpdatedIdsCh = c.updatedIdsCh c.connInfoChs = make(chan chan *connInfo) c.connErrCh = make(chan error) c.topicsOut = make(map[TopicId]*topic) diff --git a/connect.go b/connect.go index dd44bfa..759731e 100644 --- a/connect.go +++ b/connect.go @@ -86,7 +86,7 @@ func (c *Client) connectOnce() (*connInfo, error) { } info.id = msg.From select { - case c.idChannel <- info.id: + case c.updatedIdsCh <- info.id: log.Trace("Published id") default: log.Trace("No one listening for id")