[英]ESP32 - ESPAsyncWebServer - server.client()?
I am working on the ESP32 at the moment, and I need to integrate a new part in my already made program, the problem is that in my program I use a: AsyncWebServer, and this new part (camera ) works with: ESP32WebServer, so I try to integrate the camera is to make it work with my already programmed server, but I am stuck on this line:我目前正在研究 ESP32,我需要在我已经制作的程序中集成一个新部分,问题是在我的程序中我使用的是:AsyncWebServer,而这个新部分(相机)适用于:ESP32WebServer,所以我尝试集成相机是为了让它与我已经编程的服务器一起工作,但我被困在这条线上:
#include <ESP32WebServer.h> <---- #include <ESPAsyncWebServer.h>
ESP32WebServer server (80); ESP32WebServer 服务器(80); <----- AsyncWebServer server (80);
<----- AsyncWebServer 服务器 (80);
WiFiClient client = server.client (); WiFiClient client = server.client(); <-----???
<-----???
I can't find the equivalent of: server.client () when I use: AsyncWebServer.当我使用:AsyncWebServer 时,我找不到对应的:server.client()。
Thanks for any suggestions.感谢您的任何建议。
That's because ESPAsyncWebServer
doesn't use WiFiClient
objects.那是因为
ESPAsyncWebServer
不使用WiFiClient
对象。
WiFiClient
is a poorly named interface to a raw TCP connection. WiFiClient
是原始 TCP 连接的名称不佳的接口。 ESPAsyncWebServer
doesn't use WiFiClient
, it uses AsyncTCP
instead, which is where its asynchrony derives from (plus a lot of work in the web server itself). ESPAsyncWebServer
不使用WiFiClient
,而是使用AsyncTCP
,这是其异步性的来源(加上 web 服务器本身的大量工作)。
It has a client()
method, but that method returns an AsyncClient
object.它有一个
client()
方法,但该方法返回一个AsyncClient
object。 That's the closest you're going to get to getting a WiFiClient
.这是您最接近获得
WiFiClient
的方法。 Don't expect it to work exactly the same way or have exactly the same methods.不要期望它以完全相同的方式工作或具有完全相同的方法。
If you want to use the camera software with the async web server, you'll need to rewrite the camera software to work with it, or run a second web server on a different port number.如果您想将相机软件与异步 web 服务器一起使用,您需要重写相机软件以使用它,或者在不同的端口号上运行第二个 web 服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.