(PECL stomp >= 0.1.0)
Stomp::__construct -- stomp_connect — 锟斤拷一锟斤拷锟斤拷锟斤拷
锟斤拷锟斤拷锟斤拷锟斤拷锟� (constructor):
$broker
= ini_get("stomp.default_broker_uri")
[, string $username
[, string $password
[, array $headers
]]]] )锟斤拷锟教伙拷锟斤拷锟�:
$broker
= ini_get("stomp.default_broker_uri")
[, string $username
[, string $password
[, array $headers
]]]] ) : resource锟斤拷一锟斤拷锟斤拷锟斤拷锟斤拷stomp通讯协锟斤拷锟斤拷锟较拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷.
broker
锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟酵骋伙拷锟皆达拷锟绞讹拷锟斤拷锟経RI锟斤拷锟斤拷
username
锟矫伙拷锟斤拷.
password
锟斤拷锟斤拷.
headers
锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷拥锟酵凤拷锟较拷锟斤拷锟斤拷纾� receipt锟斤拷锟斤拷
Note:
A transaction header may be specified, indicating that the message acknowledgment should be part of the named transaction.
锟芥本 | 说锟斤拷 |
---|---|
1.0.1 |
锟斤拷锟斤拷锟斤拷headers 锟斤拷锟斤拷
|
Example #1 锟斤拷锟斤拷锟斤拷锟斤拷锟�
<?php
/* connection */
try {
$stomp = new Stomp('tcp://localhost:61613');
} catch(StompException $e) {
die('Connection failed: ' . $e->getMessage());
}
/* close connection */
unset($stomp);
?>
Example #2 锟斤拷锟教伙拷锟斤拷锟�
<?php
/* connection */
$link = stomp_connect('ssl://localhost:61612');
/* check connection */
if (!$link) {
die('Connection failed: ' . stomp_connect_error());
}
/* close connection */
stomp_close($link);
?>