Close PTY session
(self)
| 2497 | |
| 2498 | /// Close PTY session |
| 2499 | pub async fn close(self) -> anyhow::Result<()> { |
| 2500 | let channel = self.channel.lock().await; |
| 2501 | channel |
| 2502 | .eof() |
| 2503 | .await |
| 2504 | .map_err(|e| anyhow!("Failed to close PTY: {}", e))?; |
| 2505 | channel |
| 2506 | .close() |
| 2507 | .await |
| 2508 | .map_err(|e| anyhow!("Failed to close channel: {}", e))?; |
| 2509 | Ok(()) |
| 2510 | } |
| 2511 | |
| 2512 | /// Get connection ID |
| 2513 | pub fn connection_id(&self) -> &str { |
no outgoing calls