(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
�����������ͳһ��Դ��ʶ����URI����
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);
?>