xous-core/services/net/src/protocols.rs
bunnie 760957154e add a crappy but slightly more accurate approximation of UDP to hosted mode
It's crappy because it uses a busy wait loop to poll the udp
rx socket in order to accurately emulate the Xous async callback
feature (which is _not_ emulated for Tcp, for example).

It's more accurate because this emulation happens. But it's a lot
more complicated to implement it because zero-cost async UDP callbacks
aren't really a host-native feature (but they are a Xous-native feature!),
and I didn't want to .. pull in tokio or mio code surface into
the Xous hosted mode, seemed a bit like crushing a fly by dropping
a house on it. Maybe that's a fine solution in Oz, but Xous doesn't live in Oz.
2022-02-21 00:54:46 +08:00

34 lines
1 KiB
Rust

#[cfg(any(target_os = "none", target_os = "xous"))]
pub mod udp;
#[cfg(any(target_os = "none", target_os = "xous"))]
pub use udp::*;
#[cfg(not(any(target_os = "none", target_os = "xous")))]
pub mod udp_hosted;
#[cfg(not(any(target_os = "none", target_os = "xous")))]
pub use udp_hosted::*;
#[cfg(any(target_os = "none", target_os = "xous"))]
pub mod dns;
#[cfg(any(target_os = "none", target_os = "xous"))]
pub use dns::*;
#[cfg(not(any(target_os = "none", target_os = "xous")))]
pub mod dns_hosted;
#[cfg(not(any(target_os = "none", target_os = "xous")))]
pub use dns_hosted::*;
pub mod ping;
pub use ping::*;
#[cfg(any(target_os = "none", target_os = "xous"))]
pub mod tcp_stream;
#[cfg(any(target_os = "none", target_os = "xous"))]
pub use tcp_stream::*;
#[cfg(any(target_os = "none", target_os = "xous"))]
pub mod tcp_listener;
#[cfg(any(target_os = "none", target_os = "xous"))]
pub use tcp_listener::*;
#[cfg(not(any(target_os = "none", target_os = "xous")))]
pub mod tcp_hosted;
#[cfg(not(any(target_os = "none", target_os = "xous")))]
pub use tcp_hosted::*;