Giter VIP home page Giter VIP logo

Comments (5)

onanying avatar onanying commented on July 17, 2024

@a6965921 代码贴一下,说明一下上下文,贴个截图啥的说明一下

from mix.

a6965921 avatar a6965921 commented on July 17, 2024

跟mixphp代码没关系 任何代码都一样 是运行代码前的延迟 应该跟swoole有关系 我先去测试下swoole是不是也有这个问题

from mix.

a6965921 avatar a6965921 commented on July 17, 2024

PHP curl 请求 必须是ip 和 post 才会有延迟
public function submitinforecordzjlist()
{
$info = $this->httprepair('http://ip:9501/', array('openid' => 2133), 'post');
print_r($info);
exit();
}
public function curl_post($url, $data = array())
{

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $url);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

    // POST数据

    curl_setopt($ch, CURLOPT_POST, 1);

    // 把post的变量加上

    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

    $output = curl_exec($ch);

    curl_close($ch);

    return $output;

}

mixphp

*/ class IndexController { /** * Index * @param ServerRequest $request * @param Response $response * @return Response */ /** * @var Database */ public $db; public $dd; public function __construct() { $this->db=context()->get('database'); $this->dd=3; } public function index(ServerRequest $request, Response $response) { $content=$this->dd; return ResponseHelper::html($response, $content); } } 收到数据大概1秒后收到 其实代码运行时间是2.3毫秒 我测试过swoole没有这个问题

from mix.

onanying avatar onanying commented on July 17, 2024

看不明白,完全没明白你测试的是啥

from mix.

onanying avatar onanying commented on July 17, 2024

image

如果是请求会超过 1s ,我这里都是正常的,你检查下你环境的原因吧,无法复现。

from mix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.