SendDisconnect tells the agent to disconnect the RDP proxy. Writes go through the registry's per-agent mutex. If the session is already gone the call becomes a no-op.
(sessionID string)
| 420 | // through the registry's per-agent mutex. If the session is already gone |
| 421 | // the call becomes a no-op. |
| 422 | func (s *Sessions) SendDisconnect(sessionID string) { |
| 423 | s.mu.RLock() |
| 424 | sess, ok := s.sessions[sessionID] |
| 425 | s.mu.RUnlock() |
| 426 | if !ok { |
| 427 | return |
| 428 | } |
| 429 | _ = sess.sender.SendJSON(sess.ApiID, map[string]interface{}{ |
| 430 | "type": "rdp_proxy_disconnect", |
| 431 | "session_id": sessionID, |
| 432 | }) |
| 433 | } |
no test coverage detected