diff options
| author | Kunal Mohan <kunalmohan99@gmail.com> | 2021-04-29 16:27:14 +0530 |
|---|---|---|
| committer | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-04 20:48:16 +0530 |
| commit | 1eb732773aa583305353a1e63ffbac879f29f2d8 (patch) | |
| tree | 151dffd48d06de2cc9f06cf79dcd89187a8f94a0 /src/server | |
| parent | remove Split, OpenFile and MoveFocus from CliArgs (diff) | |
| download | sl0ppij-1eb732773aa583305353a1e63ffbac879f29f2d8.tar.gz sl0ppij-1eb732773aa583305353a1e63ffbac879f29f2d8.tar.xz sl0ppij-1eb732773aa583305353a1e63ffbac879f29f2d8.zip | |
use Uuid to generate unique server socket names
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server/mod.rs b/src/server/mod.rs index ca34861b..3e0500b0 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -16,6 +16,7 @@ use zellij_tile::data::{Event, EventType, ModeInfo}; use crate::cli::CliArgs; use crate::client::ClientInstruction; +use crate::common::UNIQUE_ZELLIJ_IPC_PIPE; use crate::common::{ errors::{ContextType, PluginContext, PtyContext, ScreenContext, ServerContext}, input::actions::{Action, Direction}, @@ -29,7 +30,6 @@ use crate::common::{ use crate::layout::Layout; use crate::panes::PaneId; use crate::panes::PositionAndSize; -use crate::utils::consts::ZELLIJ_IPC_PIPE; /// Instructions related to server-side application including the /// ones sent by client to server @@ -83,8 +83,8 @@ pub fn start_server(os_input: Box<dyn ServerOsApi>, opts: CliArgs) -> thread::Jo let sessions = sessions.clone(); let send_server_instructions = send_server_instructions.clone(); move || { - drop(std::fs::remove_file(ZELLIJ_IPC_PIPE)); - let listener = LocalSocketListener::bind(ZELLIJ_IPC_PIPE).unwrap(); + drop(std::fs::remove_file(UNIQUE_ZELLIJ_IPC_PIPE.as_str())); + let listener = LocalSocketListener::bind(UNIQUE_ZELLIJ_IPC_PIPE.as_str()).unwrap(); for stream in listener.incoming() { match stream { Ok(stream) => { @@ -132,6 +132,7 @@ pub fn start_server(os_input: Box<dyn ServerOsApi>, opts: CliArgs) -> thread::Jo ServerInstruction::ClientExit => { *sessions.write().unwrap() = None; os_input.send_to_client(ClientInstruction::Exit); + drop(std::fs::remove_file(UNIQUE_ZELLIJ_IPC_PIPE.as_str())); break; } ServerInstruction::Render(output) => { |
