|
|
@@ -3,8 +3,8 @@ use std::net::SocketAddr;
|
|
3
|
3
|
use std::sync::{Arc, Mutex};
|
|
4
|
4
|
|
|
5
|
5
|
use async_tungstenite::accept_async;
|
|
|
6
|
+use async_tungstenite::tokio::TokioAdapter;
|
|
6
|
7
|
use futures::sink::SinkExt;
|
|
7
|
|
-use futures_tokio_compat::Compat;
|
|
8
|
8
|
use log::*;
|
|
9
|
9
|
use tokio::net::{TcpListener, TcpStream};
|
|
10
|
10
|
use tokio::stream::StreamExt;
|
|
|
@@ -65,7 +65,7 @@ async fn main() {
|
|
65
|
65
|
// TODO: Robust error handling.
|
|
66
|
66
|
|
|
67
|
67
|
async fn accept_connection(peer: SocketAddr, stream: TcpStream) {
|
|
68
|
|
- let mut ws_stream = accept_async(Compat::new(stream))
|
|
|
68
|
+ let mut ws_stream = accept_async(TokioAdapter(stream))
|
|
69
|
69
|
.await
|
|
70
|
70
|
.expect("Failed to accept");
|
|
71
|
71
|
|