nit fixes
This commit is contained in:
parent
1eb732773a
commit
3f70c585c2
1 changed files with 9 additions and 2 deletions
|
|
@ -180,7 +180,8 @@ impl<T: Serialize> IpcSenderWithContext<T> {
|
||||||
fn send(&mut self, msg: T) -> Result<(), std::io::Error> {
|
fn send(&mut self, msg: T) -> Result<(), std::io::Error> {
|
||||||
let err_ctx = get_current_ctx();
|
let err_ctx = get_current_ctx();
|
||||||
self.sender
|
self.sender
|
||||||
.write_all(&bincode::serialize(&(msg, err_ctx)).unwrap())
|
.write_all(&bincode::serialize(&(msg, err_ctx)).unwrap())?;
|
||||||
|
self.sender.flush()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -404,7 +405,13 @@ impl ClientOsApi for ClientOsInputOutput {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn connect_to_server(&self) {
|
fn connect_to_server(&self) {
|
||||||
let socket = LocalSocketStream::connect(UNIQUE_ZELLIJ_IPC_PIPE.as_str()).unwrap();
|
let socket = match LocalSocketStream::connect(UNIQUE_ZELLIJ_IPC_PIPE.as_str()) {
|
||||||
|
Ok(sock) => sock,
|
||||||
|
Err(_) => {
|
||||||
|
std::thread::sleep(std::time::Duration::from_millis(20));
|
||||||
|
LocalSocketStream::connect(UNIQUE_ZELLIJ_IPC_PIPE.as_str()).unwrap()
|
||||||
|
}
|
||||||
|
};
|
||||||
let sock_fd = socket.as_raw_fd();
|
let sock_fd = socket.as_raw_fd();
|
||||||
let dup_fd = unistd::dup(sock_fd).unwrap();
|
let dup_fd = unistd::dup(sock_fd).unwrap();
|
||||||
let receiver = unsafe { LocalSocketStream::from_raw_fd(dup_fd) };
|
let receiver = unsafe { LocalSocketStream::from_raw_fd(dup_fd) };
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue