From 8d70acc5d26eb9a88a7294b55f7732e61f9a201f Mon Sep 17 00:00:00 2001 From: "Franz Heinzmann (Frando)" Date: Fri, 19 Feb 2021 19:03:34 +0100 Subject: [PATCH] OscStream -> OscUdpStream --- src/main.rs | 6 +++--- src/osc.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 871ff2e..f59ccc2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ use async_std::stream::StreamExt; use log::*; use rosc::{OscMessage, OscPacket, OscType}; -use studiox::osc::OscStream; +use studiox::osc::OscUdpStream; use studiox::spawn::FaustHandle; use studiox::switcher::{SwitcherError, SwitcherEvent, SwitcherHandle}; @@ -45,8 +45,8 @@ async fn main_loop(faust_handle: &FaustHandle) -> anyhow::Result<()> { let mut switcher = SwitcherHandle::run(); let switcher_rx = switcher.take_receiver().unwrap().map(Event::Switcher); - let faust_rx = OscStream::bind(addr_faust_rx).await?.map(Event::FaustRx); - let command_osc_rx = OscStream::bind(addr_commands).await?; + let faust_rx = OscUdpStream::bind(addr_faust_rx).await?.map(Event::FaustRx); + let command_osc_rx = OscUdpStream::bind(addr_commands).await?; let command_osc_tx = command_osc_rx.sender(); let command_osc_rx = command_osc_rx.map(Event::CommandRx); diff --git a/src/osc.rs b/src/osc.rs index a7b1a54..11688e5 100644 --- a/src/osc.rs +++ b/src/osc.rs @@ -10,11 +10,11 @@ use std::task::{Context, Poll}; use crate::switcher::SwitcherError; use crate::udp::UdpStream; -pub struct OscStream { +pub struct OscUdpStream { stream: UdpStream, } -impl OscStream { +impl OscUdpStream { pub fn new(socket: UdpSocket) -> Self { let socket = Arc::new(socket); let stream = UdpStream::new(socket); @@ -39,7 +39,7 @@ impl OscStream { OscSender::new(self.stream.clone_socket()) } } -impl Stream for OscStream { +impl Stream for OscUdpStream { type Item = Result; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let packet = ready!(Pin::new(&mut self.stream).poll_next(cx));