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


PHP event_del函数代码示例

本文整理汇总了PHP中event_del函数的典型用法代码示例。如果您正苦于以下问题:PHP event_del函数的具体用法?PHP event_del怎么用?PHP event_del使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: __destruct

 /**
  * Free from loop
  */
 public function __destruct()
 {
     if (!empty($this->event)) {
         event_del($this->event);
         event_free($this->event);
         unset($this->event);
     }
 }
开发者ID:expressif,项目名称:stream,代码行数:11,代码来源:Timer.php

示例2: removeSignal

 /**
  * Remove signal handler.
  *
  * @param $signal
  */
 public function removeSignal($signal)
 {
     if (isset($this->_signalEvents[$signal])) {
         $event = $this->_signalEvents[$signal];
         event_del($event);
         unset($this->_signalEvents[$signal]);
     }
 }
开发者ID:walkor,项目名称:workerman,代码行数:13,代码来源:LibEventLoop.php

示例3: close

 /**
  * 关闭socket
  * @param $socket
  * @param $event
  * @return unknown_type
  */
 static function close($socket, $event = null)
 {
     if ($event) {
         event_del($event);
         event_free($event);
     }
     fclose($socket);
 }
开发者ID:jasonshaw,项目名称:framework-1,代码行数:14,代码来源:Stream.php

示例4: removeStream

 public function removeStream($stream)
 {
     if (isset($this->events[(int) $stream])) {
         $event = $this->events[(int) $stream];
         event_del($event);
         event_free($event);
         unset($this->events[(int) $stream]);
     }
 }
开发者ID:romainneutron,项目名称:SocketServer,代码行数:9,代码来源:LibEventLoop.php

示例5: close

 public function close()
 {
     $this->log("close()");
     foreach (array_keys($this->clients) as $id) {
         $this->disconnectClient($id);
     }
     $this->clients = array();
     stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
     event_del($this->socket_event);
     event_free($this->socket_event);
     $this->socket_event = null;
 }
开发者ID:hinathan,项目名称:edges-php,代码行数:12,代码来源:Server.php

示例6: service

 private function service($connection, $flag, $base)
 {
     $connectionId = $this->getIdByConnection($connection);
     $buffer = event_buffer_new($connection, array($this, 'onRead'), array($this, 'onWrite'), array($this, 'onError'), $connectionId);
     event_buffer_base_set($buffer, $this->base);
     event_buffer_watermark_set($buffer, EV_READ, 0, 0xffffff);
     event_buffer_priority_set($buffer, 10);
     event_buffer_enable($buffer, EV_READ | EV_WRITE | EV_PERSIST);
     $this->buffers[$connectionId] = $buffer;
     event_del($this->events[$connectionId]);
     event_free($this->events[$connectionId]);
     unset($this->events[$connectionId]);
 }
开发者ID:JimboOneTwo,项目名称:websocket,代码行数:13,代码来源:WebsocketGenericLibevent.php

示例7: onRead

 public function onRead($socket, $event, $args)
 {
     while ($chunk = fread($socket, 4096)) {
         $this->response .= $chunk;
     }
     if (feof($socket)) {
         fclose($socket);
         event_del($args[0]);
         if ($this->config['callback']) {
             call_user_func($this->config['callback'], array('response' => $this->response));
         }
     }
 }
开发者ID:happyooboy,项目名称:AsyncHttpClient,代码行数:13,代码来源:AsyncHttpClient.php

示例8: onRequest

 public function onRequest($clientSocket, $events, $arg)
 {
     try {
         //$transport = new TBufferedTransport(new TNonblockingSocket($clientSocket));
         $transport = new TNonblockingSocket($clientSocket);
         call_user_func($this->callback, $transport);
     } catch (Exception $e) {
         \event_del($arg[0]);
         \event_free($arg[0]);
         // close socket
         @stream_socket_shutdown($clientSocket, STREAM_SHUT_RDWR);
         @fclose($clientSocket);
         return;
     }
 }
开发者ID:kaiyulee,项目名称:thrift-lib-php,代码行数:15,代码来源:TNonblockingServerSocket.php

示例9: __destruct

 /**
  * Free from loop and close the stream
  */
 public function __destruct()
 {
     if (!empty($this->ev_read)) {
         event_del($this->ev_read);
         event_free($this->ev_read);
         unset($this->ev_read);
     }
     if (!empty($this->ev_write)) {
         event_del($this->ev_write);
         event_free($this->ev_write);
         unset($this->ev_write);
     }
     if (!empty($this->stream)) {
         fclose($this->stream);
         unset($this->stream);
     }
 }
开发者ID:expressif,项目名称:stream,代码行数:20,代码来源:Event.php

示例10: sw_socket_close

/**
 * 关闭socket
 * @param $socket
 * @param $event
 * @return unknown_type
 */
function sw_socket_close($socket, $event = null)
{
    if ($event) {
        event_del($event);
        event_free($event);
    }
    stream_socket_shutdown($socket, STREAM_SHUT_RDWR);
    fclose($socket);
}
开发者ID:jinguanio,项目名称:swoole_websocket,代码行数:15,代码来源:Server.php

示例11: closeConnection

 public function closeConnection($connId)
 {
     if (Daemon::$settings['logevents']) {
         Daemon::log('[WORKER ' . Daemon::$worker->pid . '] closeConnection(' . $connId . ').');
     }
     if (!isset($this->buf[$connId])) {
         return;
     }
     if (isset($this->readEvents[$connId])) {
         event_del($this->readEvents[$connId]);
         event_free($this->readEvents[$connId]);
         unset($this->readEvents[$connId]);
     }
     event_buffer_free($this->buf[$connId]);
     if (Daemon::$useSockets) {
         socket_close(Daemon::$worker->pool[$connId]);
     } else {
         fclose(Daemon::$worker->pool[$connId]);
     }
     unset(Daemon::$worker->pool[$connId]);
     unset(Daemon::$worker->poolApp[$connId]);
     unset(Daemon::$worker->readPoolState[$connId]);
     unset($this->buf[$connId]);
     unset($this->poolQueue[$connId]);
     unset(Daemon::$worker->poolState[$connId]);
 }
开发者ID:svcorp77,项目名称:phpdaemon,代码行数:26,代码来源:asyncServer.class.php

示例12: cancelTimer

 public function cancelTimer($signature)
 {
     if (isset($this->timers[$signature])) {
         $timer = $this->timers[$signature];
         $timer->cancelled = true;
         event_del($timer->resource);
         event_free($timer->resource);
         unset($this->timers[$signature]);
     }
 }
开发者ID:unkerror,项目名称:Budabot,代码行数:10,代码来源:LibEventLoop.php

示例13: removeStream

 public function removeStream($stream)
 {
     $id = (int) $stream;
     if (isset($this->events[$id])) {
         $event = $this->events[$id];
         unset($this->events[$id], $this->flags[$id], $this->readCallbacks[$id], $this->writeCallbacks[$id]);
         event_del($event);
         event_free($event);
     }
 }
开发者ID:ramiyer,项目名称:react,代码行数:10,代码来源:LibEventLoop.php

示例14: disable

 /**
  * Disable all events of sockets
  * @return void
  */
 public function disable()
 {
     return;
     // possible critical bug
     for (; sizeof($this->socketEvents);) {
         if (!is_resource($ev = array_pop($this->socketEvents))) {
             continue;
         }
         event_del($ev);
         event_free($ev);
     }
 }
开发者ID:ruslanchek,项目名称:phpdaemon,代码行数:16,代码来源:ConnectionPool.php

示例15: remove

 function remove($event)
 {
     $ev = $event->handle;
     event_del($ev);
     return $this;
 }
开发者ID:chh,项目名称:eventor,代码行数:6,代码来源:Base.php


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