What does socket.on and socket.emit mean? I can’t seem to find explanations on the socket.io website.
What does socket.on and socket.emit mean? I can’t seem to find explanations on the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
socket.onListen to the socket on a specific keyword. Similar to JQuery onsocket.emit“sends” a message to that keywordThe following code sends a message to “keyword”
The following code listens for messages on “keyword”
keyword can be any string you want. And both code snippets can be used client and server side.