Code Monkey home page Code Monkey logo

Comments (8)

theturtle32 avatar theturtle32 commented on July 21, 2024

This is something that is intentionally left up to your application code to implement, and it's extremely easy to do so. I'll try to put up a wiki page with an example since I've gotten this question before.

from websocket-node.

giberisk avatar giberisk commented on July 21, 2024

turtle-

Thanks for your prompt response.
Can you please throw in just some quick code here, because i am stuck in the dev of my application because of this :(
I will make a donation if that is the case.

Thanks

from websocket-node.

theturtle32 avatar theturtle32 commented on July 21, 2024

I'm writing the wiki page now. I'll have something posted in the next 10 minutes.

from websocket-node.

giberisk avatar giberisk commented on July 21, 2024

Thank you so much.
Also maybe you can explain how we can assign names the the sessions.
For example ip 192.168.1.1 opens a session, and he sends "SESSION_ID:Richard".
Then the session will be renamed Richard, and can be used to push messages to the user. ( session.send ( richard, "hello" ) etc ).
I am sorry if my questions sound stupid but I am just starting with websockets and I am very excited about all this.

Thanks

from websocket-node.

theturtle32 avatar theturtle32 commented on July 21, 2024

Again, that is left to the developer intentionally. You can attach any arbitrary additional properties you wish to the connection object since JavaScript is a dynamic language, and you can add open WebSocketConnection objects to a hash based on your SESSION_ID when accepting the connection and remove it on the 'close' event.

from websocket-node.

giberisk avatar giberisk commented on July 21, 2024

I will struggle to learn more java... i`ve been up 3 days straight, learning it, since i found this server.
I am working mostly in .net on the client side.

  • I meant javascript *

from websocket-node.

theturtle32 avatar theturtle32 commented on July 21, 2024

Cool cool. JavaScript is a very fun and dynamic language, and I absolutely love working with it. Do take note though, Java and JavaScript are entirely different and unrelated things. If you try looking for Java solutions when you are working with JavaScript, you will find yourself very confused.

from websocket-node.

theturtle32 avatar theturtle32 commented on July 21, 2024

Here's the wiki page:
https://github.com/Worlize/WebSocket-Node/wiki/How-to:-List-all-connected-sessions-&-Communicating-with-a-specific-session-only

from websocket-node.

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.