MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    上报有概率报错

    BUG反馈
    1
    2
    215
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sanjiudao last edited by sanjiudao

      在使用Mirai Http和node.js进行插件开发时,当机器人接收到信息上报时,会有概率报错!

      错误信息:E/net.mamoe.mirai-api-http: 上报http://127.0.0.1:2233失败: Software caused connection abort: recv failed

      什么时候报错?
      我经过了大量的实验发现,当快速的向机器人发送信息时是不会发生报错的,会正常上报。
      但是,如果短短续续的发送信息则有概率会引起报错。

      我使用的node.js代码:
      var http = require('http');
      var querystring = require('querystring');

      http.createServer(function (req, res) {
      var post = '';
      req.on('data',function(chunk){
      post += chunk;
      });
      req.on('end',function(){
      res.end();
      post = querystring.parse(post);
      console.log(post);
      });
      }).listen(2233);

      1 Reply Last reply Reply Quote 0
      • S
        sanjiudao last edited by

        我更换了新版本的mirai-api-http进行测试,发现报错虽然没有了,但是还是有概率上报不了信息

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact