xfer
This commit is contained in:
parent
97b5fad9f1
commit
4357358ec6
@ -78,8 +78,8 @@ where
|
|||||||
pub async fn recv(&self) -> Result<Vec<u8>, String> {
|
pub async fn recv(&self) -> Result<Vec<u8>, String> {
|
||||||
let out = match self.stream.clone().next().await {
|
let out = match self.stream.clone().next().await {
|
||||||
Some(Ok(Message::Binary(v))) => v,
|
Some(Ok(Message::Binary(v))) => v,
|
||||||
Some(Ok(_)) => {
|
Some(Ok(x)) => {
|
||||||
return Err("Unexpected WS message type".to_owned()).map_err(logthru_net!(error));
|
return Err(format!("Unexpected WS message type: {:?}", x));
|
||||||
}
|
}
|
||||||
Some(Err(e)) => {
|
Some(Err(e)) => {
|
||||||
return Err(e.to_string()).map_err(logthru_net!(error));
|
return Err(e.to_string()).map_err(logthru_net!(error));
|
||||||
|
@ -56,9 +56,8 @@ impl WebsocketNetworkConnection {
|
|||||||
pub async fn recv(&self) -> Result<Vec<u8>, String> {
|
pub async fn recv(&self) -> Result<Vec<u8>, String> {
|
||||||
let out = match self.inner.ws_stream.clone().next().await {
|
let out = match self.inner.ws_stream.clone().next().await {
|
||||||
Some(WsMessage::Binary(v)) => v,
|
Some(WsMessage::Binary(v)) => v,
|
||||||
Some(_) => {
|
Some(x) => {
|
||||||
return Err("Unexpected WS message type".to_owned())
|
return Err(format!("Unexpected WS message type: {:?}", x));
|
||||||
.map_err(logthru_net!(error));
|
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
return Err("WS stream closed".to_owned()).map_err(logthru_net!(error));
|
return Err("WS stream closed".to_owned()).map_err(logthru_net!(error));
|
||||||
|
Loading…
Reference in New Issue
Block a user