Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do we need to manually handle the room leaving event? #43

Open
bigBron opened this issue May 24, 2020 · 0 comments
Open

Do we need to manually handle the room leaving event? #43

bigBron opened this issue May 24, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@bigBron
Copy link

bigBron commented May 24, 2020

Hello, @kataras , I am using the room function provided by neffos, and In my case I am not sure whether the client-side can call the Leave() method correctly, which may cause the room to not be properly recycled? Can the server-side manually disconnect the specified client connection to the room?

Rooms storage variable:

neffos/conn_namespace.go

Lines 22 to 25 in 15e3a17

// Dynamically channels/rooms for each connected namespace.
// Client can ask to join, server can forcely join a connection to a room.
// Namespace(room(fire event)).
rooms map[string]*Room

RoomJoin:

neffos/conn_namespace.go

Lines 216 to 218 in 15e3a17

ns.roomsMutex.Lock()
ns.rooms[msg.Room] = newRoom(ns, msg.Room)
ns.roomsMutex.Unlock()

RoomLeave:

neffos/conn_namespace.go

Lines 305 to 307 in 15e3a17

ns.roomsMutex.Lock()
delete(ns.rooms, msg.Room)
ns.roomsMutex.Unlock()

@bigBron bigBron added the enhancement New feature or request label May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants