Gets the current channel, if the node is connected and online, or null.

This is just a convenience method for {@link Computer#getChannel()} with null check.
191081
@CheckForNull
    public final VirtualChannel getChannel() {
        Computer c = toComputer();
        return c==null ? null : c.getChannel();
    }
503191
protected function getChannel()
    {
        if ($this->channel instanceof CmobiAMQPChannel) {
            return $this->channel;
        }
        $this->channel = $this->getConnection()->channel();

        if (!$this->channel instanceof CmobiAMQPChannel) {
            throw new InvalidAMQPChannelException('Failed get AMQPChannel');
        }

        return $this->channel;
    }
954782
public ChannelSftp getSftpChannel() throws SftpException {

    try {
      ChannelSftp channelSftp = (ChannelSftp) this.session.openChannel("sftp");
      channelSftp.connect();
      return channelSftp;
    } catch (JSchException e) {
      throw new SftpException(0, "Cannot open a channel to SFTP server", e);
    }
  }
637326
public function getChannel($channel_id = null)
    {
        $index = $channel_id ?: 'default';
        if (!array_key_exists($index, $this->channels)) {
            $this->channels[$index] = $this->connection->channel($channel_id);
        }
        return $this->channels[$index];
    }
627104
public Channel getChannel(int channelId) {
        Channel channel = channels.putIfAbsent(channelId, new Channel(this, channelId));
        if (channel == null) {
            channel = channels.get(channelId);
        }
        return channel;
    }
85227
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Connected to: {}", getRemoteAddress());
        }
    }
871899
public function getChannel()
    {
        if ($this->_oChannel === null) {
            $this->_oChannel = $this->_getRssFeed()->getChannel();
        }

        return $this->_oChannel;
    }
959337
boolean reconnect_to_channel(String name) {
        boolean ret = true;
        Enumeration callback_structs = event_callback_map.elements();
        while (callback_structs.hasMoreElements()) {
            EventCallBackStruct callback_struct = (EventCallBackStruct) callback_structs.nextElement();
            if (callback_struct.channel_name.equals(name) && (callback_struct.callback != null)) {
                try {
                    EventChannelStruct event_channel_struct = channel_map.get(name);
                    event_channel_struct.adm_device_proxy.ping();
                    connect_event_channel(new ConnectionStructure(
                            callback_struct.device.get_tango_host(),
                            name, event_channel_struct.dbase, true));
                    ret = true;
                } catch (DevFailed e1) {
                    //Except.print_exception(e1);
                    ret = false;
                }
                break;
            }
        }
        return ret;
    }
974052
static void checkChannelValidity(Object channel) throws IOException {
    if (channel == null) {
      /* Most common reason is that original socket does not have a channel.
       * So making this an IOException rather than a RuntimeException.
       */
      throw new IOException("Channel is null. Check " +
                            "how the channel or socket is created.");
    }
    
    if (!(channel instanceof SelectableChannel)) {
      throw new IOException("Channel should be a SelectableChannel");
    }    
  }
1095602
protected function getSelectedChannel()
    {
        $request = $this->get('request_stack')->getCurrentRequest();

        if (!$request instanceof Request) {
            throw new \RuntimeException('Unable to get the request');
        }

        $channel = $this->getChannelManager()->find($request->query->get('channel'));

        if (!$channel instanceof Channel) {
            $channels = $this->getChannels();
            $channel  = reset($channels);
        }

        if (!$channel instanceof Channel) {
            throw new \RuntimeException('Please configure at least one channel');
        }

        return $channel;
    }
600840
@Override
	public void channelActive(final ChannelHandlerContext ctx) throws Exception {
		if (this.ctx == null) {
			this.ctx = ctx;
		}

		super.channelActive(ctx);
	}
818965
public Node getCurrentNode()
  {

    if (!m_cacheNodes)
      throw new RuntimeException(
        XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!");

    int saved = m_next;
    Node n = (m_next < m_firstFree) ? elementAt(m_next) : null;
    m_next = saved; // HACK: I think this is a bit of a hack.  -sb
    return n;
  }
407543
def get_current_channel(self):
        """"""
        self.request(EP_GET_CURRENT_CHANNEL)
        return {} if self.last_response is None else self.last_response.get('payload')
6847
@Override
    public int getLocalPort() {
        int port = 0;

        if (udpNetworkLayer != null) {
            port = udpNetworkLayer.getDatagramSocket().getLocalPort();
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                if (port == 0) {
                    Tr.debug(tc, "getLocalPort == 0");
                }
            }
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "getLocalPort; udpNetworkLayer == null");
            }
        }
        return port;
    }
1307940
Channel getChannel() throws ConnectionFailedException {
        Channel ch = channel.get();
        if (ch == null) {
            throw new ConnectionFailedException("Connection to " + connectionName + " is not established.");
        }
        return ch;
    }
1282790
private ChannelInfo getChannelInfo(int channelId) {
        ChannelInfo info = channels.putIfAbsent(channelId, new ChannelInfo());
        if (info == null) {
            info = channels.get(channelId);
        }
        return info;
    }
761942
@Override
  public void probeChannel() {
    if (closed) return;
    
    try {
      final SocketChannel channel = preparedChannel();
      if (channel != null) {
        readConsume(channel);
      }
    } catch (IOException e) {
      logger.log("Failed to read channel selector for " + address + " because: " + e.getMessage(), e);
    }
  }