GithubHelp home page GithubHelp logo

Comments (7)

188080501 avatar 188080501 commented on July 23, 2024

你这边在Demo中可以复现吗?
这个问题是考虑到的,不应该返回true

from jqhttpserver.

hoozh avatar hoozh commented on July 23, 2024

我把 JQHttpServer 用作一个简单的 HTTP 下载服务。在一台安装过 LabView 的 PC 上发现有这个问题,查了下是 NI Application Web Server 服务,占用8080端口,但是用 JQHttpServer 依然能初始化成功。

下面的过程可以复现。

  • 启用 Everything 软件的HTTP服务器,端口设为 8080 。
  • HttpServerDemo 中端口也改为 8080,运行 HttpServerDemo,返回值为 true。
  • 浏览器访问 http://127.0.0.1:8080/,页面为 Everything。
  • 关闭 Everything HTTP 服务,页面为 HttpServerDemo 提供。

我对网络编程也不是很了解,是不是 HTTP 的端口可以共用?

另外,HttpServerDemo 中 initializeHttpServer() 执行两次,第二次确实返回 false,这是 OK 的。

from jqhttpserver.

188080501 avatar 188080501 commented on July 23, 2024

关闭 Everything HTTP 服务后,有重启过demo吗?
不重启demo,访问的页面就可以直接变成HttpServerDemo提供的吗?

from jqhttpserver.

hoozh avatar hoozh commented on July 23, 2024

没有重启demo

似乎和 demo 和 everything 的启动顺序也没有关系,两者都可以正常开启。 两个进程都开启的情况下,浏览器访问到的总是 Everything 的页面。关闭 Everything HTTP 服务后,刷新页面就变成了 demo 的页面

from jqhttpserver.

188080501 avatar 188080501 commented on July 23, 2024

帮忙测试一下,在开启Everything HTTP后,用QTcpServer监听端口,看下返回值是什么

from jqhttpserver.

hoozh avatar hoozh commented on July 23, 2024

开启Everything HTTP后,JQHttpServer::TcpServerManage::onStart 里的 QTcpServer::listen 还是返回 true 的,没有其他错误。

但是如果已经运行了一个 HttpServerDemo ,QTcpServer::listen 就是返回 false, QTcpServer::errorString 输出 “The bound address is already in use”。

我查到 socket 端口是可以复用的,有可能 EveryThing 开始 http 时设置了端口复用。

https://blog.csdn.net/KayChanGEEK/article/details/103834853

from jqhttpserver.

188080501 avatar 188080501 commented on July 23, 2024

若还有类似问题,请再开issue,此问题关闭

from jqhttpserver.

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.