简体   繁体   中英

SharedObject in node.js between server and clients

Basically I need sharedObject in node.js.

When working with flash media server, like red5 and flash client you can natively use sharedObject, that notify the connected client(s) upon update via syncevents, on the client side you can connect to sharedobjects and handle syncevents, moreover the code can handle if the client wants to poke around this synchronized objct and can disallow this move (this is necessary in an online multplayer game).

Can you suggest me some similar implementation in node.js + javascript?

Note, I don't need function or code sharing, just sharedObject + native events.

I found this topic: Is it possible to share data between the client and the server using node.js? but I think it's not for my exact directive.

My best shot is https://github.com/jonashuckestein/node-object-sync , yet. Have you used it? Is this a safe and FAST approach? If writing a sync function and passing updateable objects is faster I won't hesitate...

You should look into racer library in node.js. See here https://npmjs.org/package/racer . Also look into derby (an MVC framework) which uses racer.

If you want to develop something on your own you can use socket.io for realtime events (chat, broadcast messages) and handle the syncrhonisation/events yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM