本文整理汇总了PHP中TSocket::hacklib_initialize_statics方法的典型用法代码示例。如果您正苦于以下问题:PHP TSocket::hacklib_initialize_statics方法的具体用法?PHP TSocket::hacklib_initialize_statics怎么用?PHP TSocket::hacklib_initialize_statics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSocket
的用法示例。
在下文中一共展示了TSocket::hacklib_initialize_statics方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: microtime
$t_start = microtime(true);
$got = fwrite($this->handle_, $buf);
$write_time = microtime(true) - $t_start;
if ($got === 0 || !\hacklib_cast_as_boolean(is_int($got))) {
$read_err_detail = sprintf('%d bytes from %s:%d to localhost:%d. Spent %2.2f ms.', $buflen, $this->host_, $this->port_, $this->lport_, $write_time * 1000);
$md = stream_get_meta_data($this->handle_);
if (\hacklib_cast_as_boolean($md[\hacklib_id('timed_out')])) {
throw new TTransportException('TSocket: timeout while writing ' . $read_err_detail, TTransportException::TIMED_OUT);
} else {
$md_str = str_replace("\n", " ", print_r($md, true));
throw new TTransportException('TSocket: could not write ' . $read_err_detail, TTransportException::COULD_NOT_WRITE);
}
}
$buf = substr($buf, $got);
}
$this->writeAttemptStart_ = null;
}
public function flush()
{
$ret = fflush($this->handle_);
if ($ret === false) {
throw new TTransportException('TSocket: could not flush ' . $this->host_ . ':' . $this->port_);
}
}
public static function hacklib_initialize_statics()
{
self::hacklib_initialize_statics_InstrumentedTTransportTrait();
}
}
TSocket::hacklib_initialize_statics();