Git Product home page Git Product logo

Comments (4)

wlgq2 avatar wlgq2 commented on August 29, 2024

你做个测试就明白了。约定时间长度内,如果Server没收到任何一条Tcp消息,就会断开并删除该连接。需要间隔发心跳协议,避免自己被断开删除。

from uv-cpp.

zhangtaohbwh avatar zhangtaohbwh commented on August 29, 2024

我用 echo_server.exe 和 clients.exe做测试,把 TimerWheel中的 timeoutSec_ 成员指定为5,在同一机器上把服务和客户端都启动,但是,过了5秒后,客户端好像都没有自动断开哦,这是什么情况?如果客户端断开了,服务端会检测到断开,并输出一条日志,但是过了5秒并没有输出日志

from uv-cpp.

wlgq2 avatar wlgq2 commented on August 29, 2024

不是客户端断开,是服务端主动断开连接。前提是这五秒没有消息通信,你记得注释掉clients代码里面发送消息部分。我测试下是会断开的,服务端不会打日志,但是客户端在5s后会打一个连接被断开的日志。

from uv-cpp.

zhangtaohbwh avatar zhangtaohbwh commented on August 29, 2024

谢谢,知道了,现在正在学习您封装的libuv库uv-cpp

from uv-cpp.

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.