Comments (7)
手机上回你了,居然没发出去。。
@huangsiyuan0717
测试的话用的webbench测试工具,你搜搜Webbench使用方法就行。
客户端是无所谓的,想用客户端测试的话,得需要编写另外的客户端程序了。服务端接收的是Web形式的Socket请求,也就是网页请求,服务端代码里也写了,http1.0,1.1,客户端程序理论上只要能发出请求的都可以,就比如图书商城,可以测试一下服务器同时能响应多少订单。Webbench其实就是发送一些文本Socket。
from webserver-test.
@SpongeBab 感谢回复!
最近研究了下代码, 剩下time这个类还没看。但是目前碰到一个问题,用你的代码,我在浏览器上发送http请求给服务端,能检测到有连接,但是收不到数据,即read_num = 0
,找了一天还是没找到问题出在哪?想问下你测试过碰到这个问题吗? 如果方便的话可以加个联系方式交流一下吗?
from webserver-test.
@huangsiyuan0717
这个我也不会改😂。但我知道这是因为啥。你用原作者的代码也一样。主要是因为无法解析你浏览器发送的报文,程序能够判断HTTP1.0或者1.1,能够检测到有连接,然后返回对应的状态码,但是无法解析这个到来的报文。完整的浏览器报文字段太多了,你可以按F11查看,得在解析数据那个函数那里,依次解析每个字段。WebBench只有个报文头,所以不会发生这个问题。。
from webserver-test.
- 测试了原作者的第五版,确实一样, 然后我也试了直接写一个简单的socket send消息,效果和http的请求一样,都是只能建立连接,但是服务器端收不到数据,我写的socket send的返回也是-1。
- 测了webbench也是一样,只能有连接,服务端打印的接受数据
read_num=0
一样是0,应该是服务器就没接到数据,所以还没到解析的那一步
from webserver-test.
@huangsiyuan0717 我刚才测了一下,没问题啊。这我也不知道了。毕竟我也是半吊子。问问原作者。😂
EDIT:欢迎来个PR。😆
from webserver-test.
@SpongeBab 你是咋测的呀,我是编译你的代码后,用浏览器直接访问127.0.0.1:8888/ 服务端的read_num=0
原作者最新的代码里面,这个方法去测试是能收到read_num
的
新的代码感觉更复杂了,还没看懂逻辑。。
from webserver-test.
./webserver启动程序,然后用WebBench,我是把浏览器那网址复制到WebBench里面测试。
明天来了我也看看。你可以先看看作者那个最新版那块解析请求是咋做的。
from webserver-test.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webserver-test.