Giter Club home page Giter Club logo

Comments (4)

Taluu avatar Taluu commented on July 19, 2024

In the latest version, the line 327 points to a blank line.

Which version of socket.io are you using ?

from elephant.io.

kbu1564 avatar kbu1564 commented on July 19, 2024

Undefined offset: 3 in /var/www/lib/ElephantIO/Client.php on line 327

I think to line 336 of /lib/ElephantIO/Client.php.

$sess = explode(':', $res);
// ...
$this->session['supported_transports'] = array_flip(explode(',', $sess[3]));

When $res is "60:60:60" or "60::", it is error.

Therefore, I think like next.

$sess = explode(':', $res, 4);
if (count($sess) === 4) {
    $this->session['sid'] = $sess[0];
    $this->session['heartbeat_timeout'] = $sess[1];
    $this->session['connection_timeout'] = $sess[2];
    $this->session['supported_transports'] = array_flip(explode(',', $sess[3]));

    if (!isset($this->session['supported_transports']['websocket'])) {
        throw new \Exception('This socket.io server do not support websocket protocol. Terminating connection...');
    }
} else {
    return false;
}

from elephant.io.

sarathsprakash avatar sarathsprakash commented on July 19, 2024

I was using socket.io 1.0.6 , I changed it into 0.9.16 and now its working fine, for the first 2-5 minutes after restarting the node.js server it started showing info: undefined socket url and later it vanished. Anyway its working fine now, Thanks everyone for your help.

from elephant.io.

Taluu avatar Taluu commented on July 19, 2024

So yeah, the lib is not yet compatible with 1.X versions of Socket.IO. We working on it with the refacto-3.0 branch :)

from elephant.io.

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.