aboutsummaryrefslogtreecommitdiff
path: root/karld/src/interface/unix.rs
diff options
context:
space:
mode:
authormetamuffin <yvchraiqi@protonmail.com>2022-08-17 19:06:16 +0200
committermetamuffin <yvchraiqi@protonmail.com>2022-08-17 19:06:16 +0200
commit1ca0554367326b2004c59306e5f3c25b079e28ec (patch)
tree72258793eb33c6e32e3f0868b0a080b7f0fc81d5 /karld/src/interface/unix.rs
parentc0f90386900f0f767c7d0569e0f758d305af3d09 (diff)
downloadkarlender-1ca0554367326b2004c59306e5f3c25b079e28ec.tar
karlender-1ca0554367326b2004c59306e5f3c25b079e28ec.tar.bz2
karlender-1ca0554367326b2004c59306e5f3c25b079e28ec.tar.zst
websocket interface
Diffstat (limited to 'karld/src/interface/unix.rs')
-rw-r--r--karld/src/interface/unix.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/karld/src/interface/unix.rs b/karld/src/interface/unix.rs
index 8d038d4..324b336 100644
--- a/karld/src/interface/unix.rs
+++ b/karld/src/interface/unix.rs
@@ -1,5 +1,7 @@
use crate::{handle_packet, CLIENT_ID_COUNTER};
-use karlcommon::{socket_path, version, ClientboundPacket, ProtoError, ServerboundPacket};
+use karlcommon::{
+ interfaces::unix_path, version, ClientboundPacket, ProtoError, ServerboundPacket,
+};
use log::{debug, error, info, warn};
use std::io;
use std::io::{BufRead, BufReader, ErrorKind, Write};
@@ -7,11 +9,11 @@ use std::os::unix::net::{UnixListener, UnixStream};
use std::thread;
pub fn run() {
- if socket_path().exists() {
+ if unix_path().exists() {
info!("remove old socket");
- std::fs::remove_file(socket_path()).unwrap();
+ std::fs::remove_file(unix_path()).unwrap();
}
- let listener = UnixListener::bind(socket_path()).unwrap();
+ let listener = UnixListener::bind(unix_path()).unwrap();
info!("listening.");
loop {