GithubHelp home page GithubHelp logo

Comments (14)

vti avatar vti commented on June 8, 2024

Yes, this is a problem with Twiggy. See Issue #1

from sockjs-perl.

akarelas avatar akarelas commented on June 8, 2024

I just installed your master version of Twiggy. Should that fix the problem? (I can't check just yet, have to install everything else, too)

from sockjs-perl.

vti avatar vti commented on June 8, 2024

Yes, that should work. I use myself. I think... :)

from sockjs-perl.

akarelas avatar akarelas commented on June 8, 2024

Why not mention in the README.md that your own Twiggy is required?

That way this here issue will be un-needed.

from sockjs-perl.

vti avatar vti commented on June 8, 2024

On 03/06/2013 05:26 PM, Alexander Karelas wrote:

Why not mention in the README.md that your own Twiggy is required?

That way this here issue will be un-needed.


Reply to this email directly or view it on GitHub
#3 (comment).

Yes. I am going to add that.

from sockjs-perl.

akarelas avatar akarelas commented on June 8, 2024

Is "$stringifying" the session object the only way to get a unique id out of it?

from sockjs-perl.

vti avatar vti commented on June 8, 2024

What do you need it for?
09.03.2013 7:23 ÐÏÌØÚÏ×ÁÔÅÌØ "Alexander Karelas" [email protected]
ÎÁÐÉÓÁÌ:

Is "$stringifying" the session object the only way to get a unique id out
of it?

Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-14658354
.

from sockjs-perl.

akarelas avatar akarelas commented on June 8, 2024

I will need to keep track of which clients are in each room (to emulate the rooms functionality from socket.io). Also which rooms each client is in. This requires at least two hashes with unique ids as keys.

from sockjs-perl.

akarelas avatar akarelas commented on June 8, 2024

Also, is there a future-proof way to hook a new subroutine on the "user closed his connection" event?

I was thinking of replacing $socket->{"on_aborted"} with a subroutine that first executes what was there before, and then executes my own code. Does that seem right?

from sockjs-perl.

akarelas avatar akarelas commented on June 8, 2024

For some reason, "on_aborted" is executed twice on browser-reload.

from sockjs-perl.

vti avatar vti commented on June 8, 2024

Maybe providing a way for either subclassing and/or setting custom variables for the session object would be a good idea. This way you could save your own unique ids, and overwrite events.

As for "executed twice" this could a bug.

from sockjs-perl.

vti avatar vti commented on June 8, 2024

Ok, now you can set/get custom values by using:

$session->set(foo => 'bar');
$session->get('foo');

And overwrite session creation by providing you own factory:

SockJS->new(session_factory => sub { MySessionClass->new })

from sockjs-perl.

akarelas avatar akarelas commented on June 8, 2024

Both changes worked very well. Thank you.

from sockjs-perl.

rsarvas avatar rsarvas commented on June 8, 2024

Thanks, that helps. The demo still fails using FireFox 12 and 23 (makes initial contact, but aborts during the xhr post). IE 9 also appears to fail (xhr issues again?). On the plus side, the example code works fine now using web sockets in the latest version of Chrome.

I'm going to check the Perl module dependencies on my end again, then try to pull down the latest copy of the sockjs (JavaScript) library just to make sure this isn't a client or configuration issue.

from sockjs-perl.

Related Issues (11)

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.