From 1ca0554367326b2004c59306e5f3c25b079e28ec Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 17 Aug 2022 19:06:16 +0200 Subject: websocket interface --- karld/src/interface/unix.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'karld/src/interface/unix.rs') 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 { -- cgit v1.2.3-70-g09d2