/** * @param PhpAmqpLib_Connection_AbstractConnection $connection * @param null $channel_id * @param bool $auto_decode * @throws Exception */ public function __construct($connection, $channel_id = null, $auto_decode = true) { if ($channel_id == null) { $channel_id = $connection->get_free_channel_id(); } parent::__construct($connection, $channel_id); $this->publish_cache = array(); $this->publish_cache_max_size = 100; if ($this->debug) { PhpAmqpLib_Helper_MiscHelper::debug_msg('using channel_id: ' . $channel_id); } $this->default_ticket = 0; $this->is_open = false; $this->active = true; // Flow control $this->alerts = array(); $this->callbacks = array(); $this->auto_decode = $auto_decode; try { $this->x_open(); } catch (Exception $e) { $this->close(); throw $e; } }
/** * @param AbstractConnection $host * @param string $port * @param string $user * @param string $password * @param string $vhost * @param bool $insist * @param string $login_method * @param null $login_response * @param string $locale * @param int $connection_timeout * @param int $read_write_timeout * @param null $context * @param bool $keepalive */ public function __construct($host, $port, $user, $password, $vhost = '/', $insist = false, $login_method = 'AMQPLAIN', $login_response = null, $locale = 'en_US', $connection_timeout = 3, $read_write_timeout = 3, $context = null, $keepalive = false, $heartbeat = 0) { $io = new PhpAmqpLib_Wire_IO_StreamIO($host, $port, $connection_timeout, $read_write_timeout, $context, $keepalive, $heartbeat); parent::__construct($user, $password, $vhost, $insist, $login_method, $login_response, $locale, $io, $heartbeat); // save the params for the use of __clone, this will overwrite the parent $this->construct_params = func_get_args(); }
public function __construct($host, $port, $user, $password, $vhost = "/", $insist = false, $login_method = "AMQPLAIN", $login_response = null, $locale = "en_US", $connection_timeout = 3, $read_write_timeout = 3, $context = null) { $io = new PhpAmqpLib_Wire_IO_StreamIO($host, $port, $connection_timeout, $read_write_timeout, $context); $this->sock = $io->get_socket(); parent::__construct($user, $password, $vhost, $insist, $login_method, $login_response, $locale, $io); // save the params for the use of __clone, this will overwrite the parent $this->construct_params = func_get_args(); }
/** * @param AbstractConnection $host * @param int $port * @param string $user * @param string $password * @param string $vhost * @param bool $insist * @param string $login_method * @param null $login_response * @param string $locale * @param int $timeout * @param bool $keepalive */ public function __construct($host, $port, $user, $password, $vhost = '/', $insist = false, $login_method = 'AMQPLAIN', $login_response = null, $locale = 'en_US', $timeout = 3, $keepalive = false) { $io = new PhpAmqpLib_Wire_IO_SocketIO($host, $port, $timeout, $keepalive); parent::__construct($user, $password, $vhost, $insist, $login_method, $login_response, $locale, $io); }
public function __construct($host, $port, $user, $password, $vhost = "/", $insist = false, $login_method = "AMQPLAIN", $login_response = null, $locale = "en_US", $timeout = 3) { $io = new PhpAmqpLib_Wire_IO_SocketIO($host, $port, $timeout); parent::__construct($user, $password, $vhost, $insist, $login_method, $login_response, $locale, $io); }