Add room create and delete events.#51
Closed
vincentwoo wants to merge 1 commit intosocketio:masterfrom
Closed
Conversation
Also consolidate `del` and `delAll` functions a bit to be more symmetrical with `add` and `addAll`. Previously, `del` would not remove the `sids[id]` entry even if it deleted the socket's last room.
Member
|
Thanks for the pull request.
Actually, I'm not sure that makes sense here, since the socket would have to leave its own room too (since every socket joins the room designated by its id). Regarding your use case, since the rooms are not shared between several adapters, you'll have to handle those cases: server1.on('connection', (socket) => {
socket.join('my-room'); // emit 'create-room' with 'my-room'
});
// then, on another node
server2.on('connection', (socket) => {
socket.join('my-room'); // emit 'create-room' with 'my-room' (again)
}); |
Member
|
Merged as 155fa63 and included in |
Author
|
whoa, four years later! trippy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also consolidate
delanddelAllfunctions a bit to be more symmetrical withaddandaddAll.Previously,
delwould not remove thesids[id]entry even if it deleted the socket's last room.Addresses socketio/socket.io#2897