Git Product home page Git Product logo

Comments (2)

YeautyYE avatar YeautyYE commented on May 18, 2024

client长时间不发送数据,再次发送数据时session.sendText()无效,重新关闭再打开时可用

需要知道client长时间不发消息,连接是否被client主动断开了.

tips:每条连接对应着唯一一个session对象,也就是只要是同一条连接,在不同事件中的session都会是同一个对象.那么在连接断开时,@onclose事件也会把这个对象传进来,就可以进行连接断开的判断.另外,如果想要主动判断连接是否断开,可以使用session.isActive()

from netty-websocket-spring-boot-starter.

CoyTatia avatar CoyTatia commented on May 18, 2024

你可以写个心跳去维持连接 或者C端端每隔一段时间就往S端发送消息 就可以维持连接了

from netty-websocket-spring-boot-starter.

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.