Skip to content

Commit

Permalink
Use BatchSize typedef instead of u16 for vsock
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Mar 29, 2024
1 parent 57713c5 commit 18a9738
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions io/zenoh-links/zenoh-link-vsock/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use async_trait::async_trait;
use zenoh_core::zconfigurable;
use zenoh_link_commons::LocatorInspector;
use zenoh_protocol::core::Locator;
use zenoh_protocol::{core::Locator, transport::BatchSize};
use zenoh_result::ZResult;

#[cfg(target_os = "linux")]
Expand All @@ -47,7 +47,7 @@ impl LocatorInspector for VsockLocatorInspector {

zconfigurable! {
// Default MTU in bytes.
static ref VSOCK_DEFAULT_MTU: u16 = u16::MAX;
static ref VSOCK_DEFAULT_MTU: BatchSize = BatchSize::MAX;
// Amount of time in microseconds to throttle the accept loop upon an error.
// Default set to 100 ms.
static ref VSOCK_ACCEPT_THROTTLE_TIME: u64 = 100_000;
Expand Down
8 changes: 5 additions & 3 deletions io/zenoh-links/zenoh-link-vsock/src/unicast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ use zenoh_core::{zasyncread, zasyncwrite};
use zenoh_link_commons::{
LinkManagerUnicastTrait, LinkUnicast, LinkUnicastTrait, NewLinkChannelSender,
};
use zenoh_protocol::core::endpoint::Address;
use zenoh_protocol::core::{EndPoint, Locator};
use zenoh_protocol::{
core::{endpoint::Address, EndPoint, Locator},
transport::BatchSize,
};
use zenoh_result::{bail, zerror, ZResult};

use super::{VSOCK_ACCEPT_THROTTLE_TIME, VSOCK_DEFAULT_MTU, VSOCK_LOCATOR_PREFIX};
Expand Down Expand Up @@ -170,7 +172,7 @@ impl LinkUnicastTrait for LinkUnicastVsock {
}

#[inline(always)]
fn get_mtu(&self) -> u16 {
fn get_mtu(&self) -> BatchSize {
*VSOCK_DEFAULT_MTU
}

Expand Down

0 comments on commit 18a9738

Please sign in to comment.