Giter Site home page Giter Site logo

Comments (4)

Disintegrate avatar Disintegrate commented on June 22, 2024

I don't think there is a direct way to guarantee that the packet arrives at the client before the connection is closed. When kicking I just put the client in a queue after sending the kick notification, and wait for a small delay before terminating the connection (100ms should be enough). I also use the 'SetTimeoutTime' function to lower the amount of time I wait for the client to disconnect in case he's not responding.

from raknet.

Mellnik avatar Mellnik commented on June 22, 2024

A queue is possible but also less secure. After doing more research I found out that IMMEDIATE_PRIORITY and CloseConnection with sendNotification = true works.

from raknet.

Disintegrate avatar Disintegrate commented on June 22, 2024

I assumed you were already closing your connection with 'sendNotification = true'. On a local network this approach will always work, but when you use it over an Internet connection problems start to pop up.

Assume you have 1% packet loss, this means once every hundred kick attempts the kick message will never arrive at the client. Even if the kick message arrives it's possible it only arrives after the disconnected notification is received, causing it to be dropped. (of course this depends on the ordering channel, reliability and priority settings) So ideally you want to leave some time between sending the kick message and closing the connection (maybe a few times the round trip delay).

The reason I suggested to lower the timeout time is simply to avoid waiting for the full standard configured timeout when trying to kick a non-responsive client. The server will keep on trying to send the disconnect notification reliably until the configured timeout has passed.

from raknet.

Kiddinglife avatar Kiddinglife commented on June 22, 2024

not sure what you exactly want to solve.A possible solution in my view could be calling the close function in some function called back by client when the closing packets received.

from raknet.

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.