GithubHelp home page GithubHelp logo

使用conv模式情况下,客户端连上服务器后,关闭客户端再登录,大概率会导致通讯失败。使用KcpReconnectExampleClient示例很容易出现。 about java-kcp HOT 4 OPEN

evallili avatar evallili commented on September 4, 2024
使用conv模式情况下,客户端连上服务器后,关闭客户端再登录,大概率会导致通讯失败。使用KcpReconnectExampleClient示例很容易出现。

from java-kcp.

Comments (4)

l42111996 avatar l42111996 commented on September 4, 2024

把超时时间弄短点,或者在业务层加挥手协议,kcp是通过心跳机制检测链接是否存活的,如果在心跳时间内客户端关闭再登录,需要等心跳超时过了以后同样的conv才能链接上

from java-kcp.

evallili avatar evallili commented on September 4, 2024

image
是否可以在接收数据这里,如果remoteAddress改变了,就关闭旧通道,使用新的通道。

from java-kcp.

l42111996 avatar l42111996 commented on September 4, 2024

image 是否可以在接收数据这里,如果remoteAddress改变了,就关闭旧通道,使用新的通道。

不可行,有一种需求是从4G切换到wifi 要保证网络链接不断开,这种情况下需要remoteAddress变了但是conv没变连接不断开。

from java-kcp.

l42111996 avatar l42111996 commented on September 4, 2024

想了这个问题有一种解法:如果remoteAddress变了,conv没变,收到的包sn为0(消息的第一个包),就用把老的链接关掉,用新的链接

from java-kcp.

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.