Send server message to a specific socket #268
-
Initially congratulations again for the project. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
Ws.send ? |
Beta Was this translation helpful? Give feedback.
-
Ws.send is similar Socket.emit It is often necessary to send a message from the server to a specific client (for example, to warn that the socket on the other side has been disconnected, or that the payment method has been approved, or that the product is on its way). |
Beta Was this translation helpful? Give feedback.
-
I really don't understand the issue. ws.send sends only to ws. Where ws is a WebSocket. I don't understand the problematics |
Beta Was this translation helpful? Give feedback.
-
Oh I get it, he's thinking that ws.send is like socket.emit but no, socket.emit is more similar to ws.publish and socket.to(socket.id).emit is the ws.send |
Beta Was this translation helpful? Give feedback.
-
Sorry, I use socket.io for life, and honestly, I don't know how things work without the wrapper, there are almost no articles on the internet about uws, although socket.io 2.0 uses uws. So I suggested an excerpt on the most common / socket.io-like methods in the readme or examples, for people who want to use this lib, as well as their article on join / subs that brought me to this library which was very useful. |
Beta Was this translation helpful? Give feedback.
-
Thank you, that was what I needed to know! |
Beta Was this translation helpful? Give feedback.
Oh I get it, he's thinking that ws.send is like socket.emit but no, socket.emit is more similar to ws.publish and socket.to(socket.id).emit is the ws.send