|
|
@@ -10,6 +10,7 @@ use futures_util::stream::{SplitSink, SplitStream};
|
|
|
use ring::hmac;
|
|
|
use serde_json::json;
|
|
|
use tokio::net::TcpStream;
|
|
|
+use tokio::spawn;
|
|
|
use tokio::sync::Mutex;
|
|
|
use tokio_tungstenite::{connect_async, MaybeTlsStream, WebSocketStream};
|
|
|
use tokio_tungstenite::tungstenite::{Error, Message};
|
|
|
@@ -125,9 +126,12 @@ impl AbstractWsMode {
|
|
|
// read_tx.unbounded_send(data_c).unwrap();
|
|
|
// }
|
|
|
// } else {
|
|
|
- if read_tx.len() == 0 {
|
|
|
- read_tx.unbounded_send(data_c).unwrap();
|
|
|
- }
|
|
|
+ // if read_tx.len() == 0 {
|
|
|
+ let r = read_tx.clone();
|
|
|
+ spawn(async move {
|
|
|
+ r.unbounded_send(data_c).unwrap();
|
|
|
+ });
|
|
|
+ // }
|
|
|
// }
|
|
|
}
|
|
|
|