SAM 函数
php 手册 | 脚本学堂 | 脚本编程 | 网站编程 | 系统管理 | 服务器配置 | 数据库管理 | Php教程 | python教程 | 正则表达式 | 批处理脚本 | Centos教程 | Linux基础教程

SAMConnection->connect

(No version information available, might be only in CVS)

SAMConnection->connect Establishes a connection to a Messaging Server

说明

SAMConnection
bool connect ( string $protocol [, array $properties ] )

Calling the "connect" method on a SAMConnection object connects the PHP script to a messaging server. No messages can be sent or received until a connection is made.

参数

返回值

This method returns FALSE if an error occurs.

范例

Example #1 Creating a connection to a Messaging Server using the IBM MQSeries protocol (WMQ)

<?php

$conn
->connect(SAM_WMQ, array(SAM_HOST => 'Myhost.myco.com'SAM_PORT => 1506SAM_BROKER => 'MyBroker'));

?>

Example #2 Creating a connection with application transaction control and default host and port values

<?php

$conn
->connect(SAM_WMQ, array(SAM_BROKER => 'MyBroker'SAM_TRANSACTIONS => SAM_MANUAL));

?>

Example #3 Creating a connection to a Messaging Server using the IBM WebSphere Platform Messaging protocol (WPM)

<?php

$conn
->connect(SAM_WPM, array(SAM_ENDPOINTS => 'localhost:7278:BootstrapBasicMessaging',
                              
SAM_BUS => 'Bus1'SAM_TARGETCHAIN => 'InboundBasicMessaging'));

?>

参见


SAM 函数
php 手册 | 脚本学堂 | 脚本编程 | 网站编程 | 系统管理 | 服务器配置 | 数据库管理 | Php教程 | python教程 | 正则表达式 | 批处理脚本 | Centos教程 | Linux基础教程