php8.5
Home/ Manual/ stomp / stomp/ Stomp::getReadTimeout

Stomp::getReadTimeout

PHP function Edit on GitHub ✎

(PECL stomp >= 0.3.0)

Gets read timeout

Description

Oop (method):

Stomp::getReadTimeout(): array

Procedural:

stomp_get_read_timeout(resource $link): array

Gets read timeout

Parameters

Return Values

Returns an array with 2 elements: sec and usec.

Examples

Oop

php
<?php

/* connection */
try {
    $stomp = new Stomp('tcp://localhost:61613');
} catch(StompException $e) {
    die('Connection failed: ' . $e->getMessage());
}

var_dump($stomp->getReadTimeout());

/* close connection */
unset($stomp);

?>

The above example will output something similar to:

output
array(2) {
  ["sec"]=>
  int(2)
  ["usec"]=>
  int(0)
}

Procedural

php
<?php

/* connection */
$link = stomp_connect('ssl://localhost:61612');

/* check connection */
if (!$link) {
    die('Connection failed: ' . stomp_connect_error());
}

var_dump(stomp_get_read_timeout($link));

/* close connection */
stomp_close($link);

?>

The above example will output something similar to:

output
array(2) {
  ["sec"]=>
  int(2)
  ["usec"]=>
  int(0)
}

Source: reference/stomp/stomp/getreadtimeout.xml · from the official PHP manual (php/doc-en)