-
Explain to a non-technical recruiter what the Chat Example (above) does.
- The server can push messages to clients. Whenever you write a chat message, the idea is that the server will get it and push it to all other connected clients.
-
What proof of life are we getting on the backend from the above app?
- "Hello world" should show up on local host 3000.
-
Socket.IO gives us the i0.emit() method to send an event to everyone. What flag would you use if you want to send a message to everyone except for a certain emitting socket?
broadcastflag
-
What is a room and how might a room be useful?
- A room is an arbitrary channel that sockets can join and leave. It can be used to broadcast events to a subset of clients.
-
How do you join a room?
socket.join("some room")
-
How do you leave a room?
socket.leave("some room")
-
What is a namespace and what does it allow you to do?
- A namespace is a way to separate sockets into different groups. It allows you to segment the users by purpose or function.
-
Each namespace potentially has its own ___________? (hint: 3 things)
- Each namespace potentially has its own
defaultroom,connectionevent, anddisconnectevent.
- Each namespace potentially has its own
-
Discuss a possible use case for separate namespaces.
- A possible use case for separate namespaces is to separate the users by purpose or function. ie. you could have a namespace for the chat room and a namespace for the game room.
-
What are your learning goals after reading and reviewing the class README?
- Goal 1: My goal is simple - I want to create a chat room that allows users to send messages to each other.
- I want to learn how exactly sockets work. I want to know how to create a chat room that allows users to send messages to each other.
