Changes
parent: tbd commit: 5ede041
1 | use ; |
2 | |
3 | use ; |
4 | use ; |
5 | use Listeners; |
6 | use |
7 | , |
8 | , |
9 | , | Mutex
10 | ; |
11 | use ; |
12 | |
13 | |
14 | extern crate tracing; |
15 | |
16 | |
17 | async |
18 | let mut listener = bind .await?; |
19 | let mut connections: = default; |
20 | let mut listeners: = default; |
21 | |
22 | loop |
23 | let stream = accept_stream .await; |
24 | |
25 | let = match stream |
26 | Ok => stream, |
27 | Err => |
28 | error!; |
29 | continue; |
30 | |
31 | ; |
32 | |
33 | let connection = accept_websocket_connection .await; |
34 | |
35 | let connection = match connection |
36 | Ok => connection, |
37 | Err => |
38 | error! |
39 | "Failed to initiate Websocket connection from {}. {:?}", |
40 | address, err |
41 | ; |
42 | continue; |
43 | |
44 | ; |
45 | |
46 | let connection = RawConnection |
47 | task: spawn |
48 | connection, |
49 | listeners.clone, |
50 | connections.clone, |
51 | address, |
52 | , |
53 | ; |
54 | |
55 | connections.lock .await.connections.push; |
56 | |
57 | |
58 | |
59 | async |
60 | listener: &mut TcpListener, |
61 | |
62 | let stream = listener.accept .await?; |
63 | |
64 | Ok |
65 | |
66 | |
67 | async |
68 | stream: S, |
69 | |
70 | let connection = accept_async .await?; |
71 | |
72 | Ok |
73 | |
74 |