Graceful close. Consumes the handle and removes the entry immediately.
(self)
| 89 | |
| 90 | /// Graceful close. Consumes the handle and removes the entry immediately. |
| 91 | pub fn close(self) { |
| 92 | let mut mgr = super::NET_MANAGER.lock().unwrap(); |
| 93 | if let Some(entry) = mgr.websockets.get(&self.id) { |
| 94 | entry.state.close(); |
| 95 | } |
| 96 | mgr.websockets.remove(&self.id); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | /// Internal state for a tracked WebSocket (native). |
no test coverage detected