public function channel($channelId = null)
    {
        if (isset($this->channels[$channelId])) {
            return $this->channels[$channelId];
        } else {
            $channelId = $channelId ? : $this->getFreeChannelId();
            $ch = new Channel($this->connection, $channelId);
            return $this->channels[$channelId] = $ch;
        }
    }