本文整理汇总了PHP中EventUtil::getLastSocketError方法的典型用法代码示例。如果您正苦于以下问题:PHP EventUtil::getLastSocketError方法的具体用法?PHP EventUtil::getLastSocketError怎么用?PHP EventUtil::getLastSocketError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventUtil
的用法示例。
在下文中一共展示了EventUtil::getLastSocketError方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ev_error
public function ev_error($listener, $ctx)
{
$errno = EventUtil::getLastSocketErrno();
fprintf(STDERR, "Got an error %d (%s) on the listener. Shutting down.\n", $errno, EventUtil::getLastSocketError());
if ($errno != 0) {
$this->base->exit(NULL);
exit;
}
}
示例2: echoEventCallback
public function echoEventCallback($bev, $events, $ctx)
{
if ($events & EventBufferEvent::ERROR) {
echo "Error from bufferevent\n";
}
if ($events & (EventBufferEvent::EOF | EventBufferEvent::ERROR)) {
$bev->free();
$error_no = EventUtil::getLastSocketErrno();
$error_msg = EventUtil::getLastSocketError();
$log = "line: " . __LINE__ . ", {$error_msg} ({$error_no})";
var_dump($log);
}
}
示例3: onStateEv
/**
* Called when the connection state changed
* @param object $bev EventBufferEvent
* @param integer $events Events
* @return void
*/
public function onStateEv($bev, $events)
{
if ($events & \EventBufferEvent::CONNECTED) {
$this->onWriteEv($bev);
} elseif ($events & (\EventBufferEvent::ERROR | \EventBufferEvent::EOF | \EventBufferEvent::TIMEOUT)) {
try {
if ($this->finished) {
return;
}
if ($events & \EventBufferEvent::ERROR) {
$errno = \EventUtil::getLastSocketErrno();
if ($errno !== 0) {
$this->log('Socket error #' . $errno . ':' . \EventUtil::getLastSocketError());
}
if ($this->ssl && $this->bev) {
while ($err = $this->bev->sslError()) {
$this->log('EventBufferEvent SSL error: ' . $err);
}
}
}
$this->finished = true;
$this->onFinish();
$this->close();
} catch (\Exception $e) {
Daemon::uncaughtExceptionHandler($e);
}
}
}
示例4: callback_accept_error
/**
* callback_accept_error
*
* @param mixed $listener
* @access public
* @return void
*/
public function callback_accept_error($listener)
{
$error_no = \EventUtil::getLastSocketErrno();
$error_msg = \EventUtil::getLastSocketError();
$log = "listener accept error, {$error_msg} ({$error_no})";
$this->log($log, LOG_WARNING);
}
示例5: callback_accept_error
function callback_accept_error($listener, $base)
{
echo "accept error running...\n";
fprintf(STDOUT, "Got an error %d (%s) on the listener. Shutting down.\n", EventUtil::getLastSocketErrno(), EventUtil::getLastSocketError());
$base->exit();
}
示例6: accept_error_cb
public function accept_error_cb($listener, $ctx)
{
$base = $this->base;
fprintf(STDERR, "Got an error %d (%s) on the listener. " . "Shutting down.\n", EventUtil::getLastSocketErrno(), EventUtil::getLastSocketError());
$base->exit(NULL);
}