X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=core%2Fconnection.go;h=935693ebc878916756f1a8e2ee6aeb9eae3fa556;hb=c09ee3241377aae2530a73d48c4e20641d76d0ee;hp=ee5a06b82e04fe76c96ec2a7a132b2c45fb325a4;hpb=debc52dea8a81417bb08ca5bb934c7876b6d65e0;p=govpp.git diff --git a/core/connection.go b/core/connection.go index ee5a06b..935693e 100644 --- a/core/connection.go +++ b/core/connection.go @@ -245,14 +245,7 @@ func (c *Connection) newAPIChannel(reqChanBufSize, replyChanBufSize int) (*Chann return nil, errors.New("nil connection passed in") } - // create new channel - chID := uint16(atomic.AddUint32(&c.maxChannelID, 1) & 0x7fff) - channel := newChannel(chID, c, c.codec, c, reqChanBufSize, replyChanBufSize) - - // store API channel within the client - c.channelsLock.Lock() - c.channels[chID] = channel - c.channelsLock.Unlock() + channel := c.newChannel(reqChanBufSize, replyChanBufSize) // start watching on the request channel go c.watchRequests(channel)