@return CmobiAMQPChannel

@throws InvalidAMQPChannelException
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;
    }
899107
private function buildSocket()
    {
        $socketDescriptor = sprintf(
            "%s://%s:%d",
            $this->scheme,
            $this->host,
            $this->port
        );

        $socket = @stream_socket_client(
            $socketDescriptor,
            $errNo,
            $errStr,
            $this->connectTimeout,
            \STREAM_CLIENT_CONNECT,
            stream_context_create($this->context)
        );

        if ($socket === false) {
            throw new RuntimeException(
                sprintf(
                    "Failed to create socket-client for %s: %s (%s)",
                    $socketDescriptor,
                    $errStr,
                    $errNo
                )
            );
        }

        // set non-blocking for UDP
        if (strcasecmp("udp", $this->scheme) == 0) {
            stream_set_blocking($socket, 0);
        }

        return $socket;
    }
616204
@Override
	public ChannelInput<ByteBuf> getInput() {
		return input -> {
			this.input = sanitize(input);
			//noinspection ConstantConditions
			if (this.input != null && this.output != null) startProcess();
			return getProcessCompletion();
		};
	}
372746
public function getMessage($queue, $auto_ack = false)
    {
        if (!isset($this->_queues[$queue])) {
            throw new InvalidKeyException(['retrieve message from queue failed: `:queue` queue is NOT exists`', 'queue' => $queue]);
        }

        try {
            $envelope = $this->_queues[$queue]->get($auto_ack ? AMQP_AUTOACK : AMQP_NOPARAM);
        } catch (\Exception $e) {
            throw new AmqpException(['retrieve message from `:queue` queue failed: :error ', 'queue' => $queue, 'error' => $e->getMessage()]);
        }

        return $envelope === false ? false : new Message($this, $queue, $envelope);
    }
382353
@Bean
    public Queue authenticationReceiverQueue() {
        return QueueBuilder.nonDurable(amqpProperties.getAuthenticationReceiverQueue()).autoDelete()
                .withArguments(getTTLMaxArgsAuthenticationQueue()).build();
    }
1235937
public function declareQueue() {

        $durable = boolval($this->flags & AMQP_DURABLE);
        $passive = boolval($this->flags & AMQP_PASSIVE);
        $exclusive = boolval($this->flags & AMQP_EXCLUSIVE);
        $auto_delete = boolval($this->flags & AMQP_AUTODELETE);

        try {
            list($this->name, $num_messages) = $this->channel->_getChannel()->queue_declare($this->name, $passive, $durable, $exclusive, $auto_delete, $nowait = false, $this->arguments);
        } catch (AMQPRuntimeException $e) {
            throw new AMQPConnectionException($e->getMessage(), $e->getCode(), $e->getPrevious());
        } catch (Exception $e) {
            return 0;
        }

        return $num_messages;
    }
1032406
public function forceReconnect(CmobiAMQPConnection $connection = null)
    {
        do {
            try {
                $failed = false;
                fwrite($this->logOutput, 'start Queue::forceReconnect() - trying connect...' . PHP_EOL);
                $this->connection = $this->getConnectionManager()->getConnection($this->connectionName);
                $this->channel = $this->getConnection()->channel();
                $this->createQueue();
            } catch (\Exception $e) {
                $failed = true;
                sleep(3);
                fwrite($this->errOutput, 'failed Queue::forceReconnect() - ' . $e->getMessage() . PHP_EOL);
            }
        } while ($failed);
        fwrite($this->logOutput, 'Queue::forceReconnect() - connected!' . PHP_EOL);

        return $this->channel;
    }
448108
@Bean
	public SubscribableChannel clientInboundChannel() {
		ExecutorSubscribableChannel executorSubscribableChannel = new ExecutorSubscribableChannel(
				clientInboundChannelExecutor());
		configureClientInboundChannel(executorSubscribableChannel);
		return executorSubscribableChannel;
	}
276802
JmsConnectionImpl instantiateConnection(JmsJcaConnection jcaConnection, Map _passThruProps) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "instantiateConnection", jcaConnection);
    JmsQueueConnectionImpl jmsQueueConnection = new JmsQueueConnectionImpl(jcaConnection, isManaged(), _passThruProps);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "instantiateConnection",  jmsQueueConnection);
    return jmsQueueConnection;
  }
199780
public function connect() {
        $readWriteTimeout = max($this->read_timeout, $this->write_timeout); //?
        try {
            $this->connection = new AMQPStreamConnection(
                $this->host,
                $this->port,
                $this->login,
                $this->password,
                $this->vhost,
                false,                      //insist
                'AMQPLAIN',                 //login method
                null,                       //login response
                'en_US',                    //locale
                $this->connect_timeout,     // connect_timeout
                $readWriteTimeout,          // read_write_timeout
                null,                       // context
                $this->keepalive,           // keepalive
                $this->heartbeat            // heartbeat configuration
            );

            //Several exception types might be thrown
        } catch (Exception $e){
            throw new AMQPConnectionException($e->getMessage(), $e->getCode(), $e->getPrevious());
        }
    }
184120
protected final Channel fakeChannel() {
        if (channel == null) {
            channel = new FakeChannel(eventLoop(), alloc(), remoteAddress(), localAddress());
        }
        return channel;
    }
1178587
public SegmentationMessage createSGM(int cic) {
        SegmentationMessage msg = createSGM();
        CircuitIdentificationCode code = this.parameterFactory.createCircuitIdentificationCode();
        code.setCIC(cic);
        msg.setCircuitIdentificationCode(code);
        return msg;
    }
1232688
public function declareQueue($name, $flags = AMQP_DURABLE)
    {
        if (isset($this->queues[$name])) {
            throw new InvalidKeyException(['declare `:queue` queue failed: it is exists already', 'queue' => $name]);
        }

        try {
            $queue = new \AMQPQueue($this->_channel);

            $queue->setName($name);
            $queue->setFlags($flags);

            $queue->declareQueue();
        } catch (\Exception $e) {
            throw new AmqpException(['declare `:queue` queue failed: `:error`', 'queue' => $name, 'error' => $e->getMessage()]);
        }

        $this->_queues[$name] = $queue;

        return $queue;
    }
1127405
@Override
    public CircuitGroupQueryMessage createCQM() {
        CircuitGroupQueryMessage msg = new CircuitGroupQueryMessageImpl(_CQM_HOLDER.mandatoryCodes,
                _CQM_HOLDER.mandatoryVariableCodes, _CQM_HOLDER.optionalCodes, _CQM_HOLDER.mandatoryCodeToIndex,
                _CQM_HOLDER.mandatoryVariableCodeToIndex, _CQM_HOLDER.optionalCodeToIndex);
        return msg;
    }
737856
static <W, R> TcpClientImpl<W, R> _create(ClientState<W, R> state,
                                                                      TcpClientEventPublisher eventPublisher) {
        DetachedChannelPipeline channelPipeline = state.unsafeDetachedPipeline();
        state = state.channelProviderFactory(new TcpChannelProviderFactory(channelPipeline,
                                                                           state.getChannelProviderFactory()));

        HostConnectorFactory<W, R> hostConnectorFactory = new HostConnectorFactory<>(state, eventPublisher);

        ConnectionProvider<W, R> cp = state.getFactory()
                                             .newProvider(state.getHostStream().map(hostConnectorFactory));

        InterceptingTcpClient<W, R> interceptingTcpClient = new InterceptingTcpClientImpl<>(cp, eventPublisher);
        TcpClientImpl<W, R> client = new TcpClientImpl<>(state, eventPublisher, interceptingTcpClient);
        client.requestSetLazily = new ConnectionRequestImpl<>(cp);
        return client;
    }
709392
public function chanMasq()
    {
        try
        {
            return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_MASQ );
        }
        catch( \Cityware\Snmp\Exception $e )
        {
            return null;
        }
    }
1181394
public EpollSocketChannelConfig setSoBusyPoll(int loopMicros) {
        try {
            ((EpollSocketChannel) channel).socket.setSoBusyPoll(loopMicros);
            return this;
        } catch (IOException e) {
            throw new ChannelException(e);
        }
    }