当前位置: 首页>>代码示例>>PHP>>正文


PHP ZMQSocket::setsockopt方法代码示例

本文整理汇总了PHP中ZMQSocket::setsockopt方法的典型用法代码示例。如果您正苦于以下问题:PHP ZMQSocket::setsockopt方法的具体用法?PHP ZMQSocket::setsockopt怎么用?PHP ZMQSocket::setsockopt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZMQSocket的用法示例。


在下文中一共展示了ZMQSocket::setsockopt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * 构造函数
  *
  * @params $context   ZMQContext
  * @params $endpoints 套接字链接到的端点
  */
 public function __construct($context, $endpoints)
 {
     if (APS::get_instance()->get_zmq_enabled()) {
         $socket = new ZMQSocket($context, ZMQ::SOCKET_XREQ);
         $socket->setsockopt(ZMQ::SOCKOPT_LINGER, 0);
         $socket->setsockopt(ZMQ::SOCKOPT_HWM, 1000);
         foreach ($endpoints as $endpoint) {
             $socket->connect($endpoint);
         }
         self::$sockets[] = $socket;
         $this->socket = $socket;
     }
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:19,代码来源:Client.php

示例2: __construct

 public function __construct($spID = null, $spVer = null, $sender = null, $linger = 100, $sndhwm = 1000, $rcvhwm = 1000)
 {
     if (self::$context === null) {
         self::$context = new ZMQContext(1, false);
         self::$poller = new ZMQPoll();
     }
     $socket = new ZMQSocket(self::$context, ZMQ::SOCKET_DEALER);
     $socket->setsockopt(ZMQ::SOCKOPT_LINGER, $linger);
     $socket->setsockopt(ZMQ::SOCKOPT_SNDHWM, $sndhwm);
     $socket->setsockopt(ZMQ::SOCKOPT_RCVHWM, $rcvhwm);
     self::$poller->add($socket, ZMQ::POLL_IN);
     $this->socket = $socket;
     $this->spID = $spID;
     $this->spVer = $spVer;
     $this->sender = $sender;
 }
开发者ID:emilymwang8,项目名称:cms,代码行数:16,代码来源:Client12.php

示例3: ZMQContext

 /**
  * Creates an APS client and returns the handler.
  *
  * @param $spID string
  * @param $spVer string
  * @param $sender string
  * @return The APS client handler on success or false on failure.
  */
 function aps_new($spID = null, $spVer = null, $sender = null)
 {
     if (APSContext::$context === null) {
         APSContext::$context = new ZMQContext(3, false);
     }
     $socket = new ZMQSocket(APSContext::$context, ZMQ::SOCKET_DEALER);
     $socket->setsockopt(ZMQ::SOCKOPT_LINGER, APSContext::$linger);
     /*
             $socket->setsockopt(ZMQ::SOCKOPT_SNDHWM, APSContext::$sndhwm);
             $socket->setsockopt(ZMQ::SOCKOPT_RCVHWM, APSContext::$rcvhwm);
     */
     if (APSContext::$poller === null) {
         APSContext::$poller = new ZMQPoll();
     }
     APSContext::$poller->add($socket, ZMQ::POLL_IN);
     //Add item to the poll set
     $aps = new StdClass();
     $aps->socket = $socket;
     $aps->spID = $spID;
     $aps->spVer = $spVer;
     $aps->sender = $sender;
     return $aps;
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:31,代码来源:APS12.php


注:本文中的ZMQSocket::setsockopt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。