disconnect implements the binder[*ServerSession] interface, so that Servers can be connected using [connect].
(cc *ServerSession)
| 990 | // disconnect implements the binder[*ServerSession] interface, so that |
| 991 | // Servers can be connected using [connect]. |
| 992 | func (s *Server) disconnect(cc *ServerSession) { |
| 993 | s.mu.Lock() |
| 994 | defer s.mu.Unlock() |
| 995 | s.sessions = slices.DeleteFunc(s.sessions, func(cc2 *ServerSession) bool { |
| 996 | return cc2 == cc |
| 997 | }) |
| 998 | |
| 999 | for _, subscribedSessions := range s.resourceSubscriptions { |
| 1000 | delete(subscribedSessions, cc) |
| 1001 | } |
| 1002 | s.opts.Logger.Info("server session disconnected", "session_id", cc.ID()) |
| 1003 | } |
| 1004 | |
| 1005 | // ServerSessionOptions configures the server session. |
| 1006 | type ServerSessionOptions struct { |