File indexing completed on 2025-01-19 05:21:24
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_Queue 0017 * @subpackage Stomp 0018 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0019 * @license http://framework.zend.com/license/new-bsd New BSD License 0020 * @version $Id$ 0021 */ 0022 0023 /** 0024 * The Stomp client interacts with a Stomp server. 0025 * 0026 * @category Zend 0027 * @package Zend_Queue 0028 * @subpackage Stomp 0029 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0030 * @license http://framework.zend.com/license/new-bsd New BSD License 0031 */ 0032 interface Zend_Queue_Stomp_Client_ConnectionInterface 0033 { 0034 /** 0035 * @param string $scheme ['tcp', 'udp'] 0036 * @param string host 0037 * @param integer port 0038 * @param string class - create a connection with this class; class must support Zend_Queue_Stomp_Client_Connection_Interface 0039 * @return boolean 0040 */ 0041 public function open($scheme, $host, $port); 0042 0043 /** 0044 * @param boolean $destructor 0045 * @return void 0046 */ 0047 public function close($destructor = false); 0048 0049 /** 0050 * Check whether we are connected to the server 0051 * 0052 * @return true 0053 * @throws Zend_Queue_Exception 0054 */ 0055 public function ping(); 0056 0057 /** 0058 * write a frame to the stomp server 0059 * 0060 * example: $response = $client->write($frame)->read(); 0061 * 0062 * @param Zend_Queue_Stomp_FrameInterface $frame 0063 * @return $this 0064 */ 0065 public function write(Zend_Queue_Stomp_FrameInterface $frame); 0066 0067 /** 0068 * tests the socket to see if there is data for us 0069 */ 0070 public function canRead(); 0071 0072 /** 0073 * reads in a frame from the socket or returns false. 0074 * 0075 * @return Zend_Queue_Stomp_Frame|false 0076 * @throws Zend_Queue_Exception 0077 */ 0078 public function read(); 0079 0080 /** 0081 * Set the frame class to be used 0082 * 0083 * This must be a Zend_Queue_Stomp_FrameInterface. 0084 * 0085 * @param string $class 0086 * @return Zend_Queue_Stomp_Client_ConnectionInterface; 0087 */ 0088 public function setFrameClass($class); 0089 0090 /** 0091 * Get the frameClass 0092 * 0093 * @return string 0094 */ 0095 public function getFrameClass(); 0096 0097 /** 0098 * create an empty frame 0099 * 0100 * @return Zend_Queue_Stomp_FrameInterface class 0101 */ 0102 public function createFrame(); 0103 }