當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TSocket::hacklib_initialize_statics方法代碼示例

本文整理匯總了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();
開發者ID:davidnasar,項目名稱:fbthrift,代碼行數:30,代碼來源:TSocket.php


注:本文中的TSocket::hacklib_initialize_statics方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。