Skip to content

Commit

Permalink
core: make BufferedSocket generic over transport
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxVerevkin committed Mar 2, 2024
1 parent fdb51dd commit 9f865b2
Show file tree
Hide file tree
Showing 5 changed files with 552 additions and 464 deletions.
10 changes: 3 additions & 7 deletions wayrs-client/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ use crate::protocol::*;
use crate::proxy::Proxy;
use crate::EventCtx;

use wayrs_core::{
ArgType, ArgValue, BufferedSocket, Interface, IoMode, Message, MessageBuffersPool, ObjectId,
SendMessageError,
};
use wayrs_core::transport::{BufferedSocket, SendMessageError};
use wayrs_core::{ArgType, ArgValue, Interface, IoMode, Message, MessageBuffersPool, ObjectId};

#[cfg(feature = "tokio")]
use tokio::io::unix::AsyncFd;
Expand Down Expand Up @@ -91,13 +89,11 @@ impl<D> Connection<D> {
path.push(runtime_dir);
path.push(wayland_disp);

let socket = BufferedSocket::from(UnixStream::connect(path)?);

let mut this = Self {
#[cfg(feature = "tokio")]
async_fd: None,

socket,
socket: BufferedSocket::new(UnixStream::connect(path)?),
msg_buffers_pool: MessageBuffersPool::default(),

object_mgr: ObjectManager::new(),
Expand Down
Loading

0 comments on commit 9f865b2

Please sign in to comment.