GithubHelp home page GithubHelp logo

How to keep session alive... about pawl HOT 7 CLOSED

ratchetphp avatar ratchetphp commented on August 29, 2024 1
How to keep session alive...

from pawl.

Comments (7)

mbonneau avatar mbonneau commented on August 29, 2024 3

@kost-g You can send a periodic ping using something like:

$loop->addPeriodicTimer(30, function () use ($conn) {
    $conn->send(new Frame('', true, Frame::OP_PING));
});

from pawl.

cboden avatar cboden commented on August 29, 2024 1

Connections are automatically persistent. If the connection is severed after 1 minute my best guess is you have a proxy that is severing connections after 1 minute.

Code 1006 is ABNORMAL_CLOSE which happens when the underlying TCP connection is severed without a proper closing handshake between the client and server.

Please provide more info about your client and server if you require more help troubleshooting.

from pawl.

kost-g avatar kost-g commented on August 29, 2024

It fails with code : Connection closed (1006 - Underlying connection closed) ?

from pawl.

kost-g avatar kost-g commented on August 29, 2024

Maybe you are because I checked in Fiddler and response return with Header: keep-alive timeout=10 max=100

from pawl.

kost-g avatar kost-g commented on August 29, 2024

So as I see in FIddler WebSocket connection don't establish Probably I should add some headers for request...

from pawl.

kost-g avatar kost-g commented on August 29, 2024

I am using Open Server for Windows

from pawl.

skecskes avatar skecskes commented on August 29, 2024

In my case I'm receiving Connection closed (1000 - ) after 1 minute. The websocket server I consume is set up in a way that it never sends pings. It sends only messages. If the client doesn't send ping after 60 seconds, the server will disconnect me. I can see in browser in developer console that some javascript client sends ping every 25 seconds and never gets disconnected.

Is there a way to set auto-ping seconds or can you show a simple example how could I send ping every 30 seconds?
Thanks

from pawl.

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.