1
petelin OP root@env-pay:~# siege -b -c 200 http://127.0.0.1:8080/
** SIEGE 3.0.8 ** Preparing 200 concurrent users for battle. The server is now under siege...^C Lifting the server siege... done. Transactions: 422665 hits Availability: 100.00 % Elapsed time: 73.83 secs Data transferred: 12.50 MB Response time: 0.03 secs Transaction rate: 5724.84 trans/sec Throughput: 0.17 MB/sec Concurrency: 199.12 Successful transactions: 422665 Failed transactions: 0 Longest transaction: 3.22 Shortest transaction: 0.00 |
2
godymho 2017-11-02 21:19:13 +08:00
asynico 跟 多个客户端建立连接之后,服务端如何主动跟客户端发送 tcp 包呢?
|
3
petelin OP 直接创建一个 task, 然后在里面写逻辑就行了,
create_task(muti_handler(client_socket)) 更多是通过 epoll 来调度你的服务器处理函数, 想清楚怎么调度就好了... 我写的这个, 就是不管客户端发什么过来, 我都直接 return html, 其实处理逻辑都可以和以前一样的 |