File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -172,14 +172,15 @@ func (a *Acceptor) Stop() {
172172 }
173173}
174174
175- // StopSession logs out a specific session and closes its connection.
176- func (a * Acceptor ) StopSession (sessionID SessionID ) error {
175+ // StopSession logs out a specific session with a reason and closes its connection.
176+ // The reason is sent to the client in the Logout message's Text (58) field.
177+ func (a * Acceptor ) StopSession (sessionID SessionID , reason string ) error {
177178 session , ok := lookupSession (sessionID )
178179 if ! ok || session == nil {
179180 return errUnknownSession
180181 }
181182 if session .IsLoggedOn () {
182- _ = session .initiateLogout ("Session logout requested" )
183+ _ = session .initiateLogout (reason )
183184 }
184185 if conn , ok := a .sessionConn .Load (sessionID ); ok && conn != nil {
185186 _ = conn .(net.Conn ).Close ()
You can’t perform that action at this time.
0 commit comments