javascript - Why is socket.post() slow as compared to socket.emit() [Its too slow] -
javascript - Why is socket.post() slow as compared to socket.emit() [Its too slow] -
i building resumeable file uploader in nodejs. first implemented in raw node.js using socket.emit()
ported sails.js , made calls sails controllers using socket.post()
client. figured out implementation using socket.emit()
much faster 1 using socket.post()
. can body tell me why..??
socket.post doesn't really exist. it's convenience method added sails in sails.io.js
. allows false post request on sockets goes through routing etc allowing utilize restful setup on sockets.
using emit emits event on specific socket connection on can react server side. doesn't go through routing unless inquire to. here's link specific line in 0.9.
so, recap, socket.post()
magic, whereas socket.emit()
doesn't, , uses emit method supplied socket.io.
javascript node.js socket.io sails.js
Comments
Post a Comment