Winify – Diff between revs 21 and 24
?pathlinks?
Rev 21 | Rev 24 | |||
---|---|---|---|---|
Line 7... | Line 7... | |||
7 | using System.Text; |
7 | using System.Text; |
|
8 | using System.Threading; |
8 | using System.Threading; |
|
9 | using System.Threading.Tasks; |
9 | using System.Threading.Tasks; |
|
10 | using Newtonsoft.Json; |
10 | using Newtonsoft.Json; |
|
11 | using Serilog; |
11 | using Serilog; |
|
- | 12 | using Servers; |
||
12 | using ClientWebSocket = System.Net.WebSockets.Managed.ClientWebSocket; |
13 | using ClientWebSocket = System.Net.WebSockets.Managed.ClientWebSocket; |
|
Line 13... | Line 14... | |||
13 | |
14 | |
|
14 | namespace Winify.Gotify |
15 | namespace Winify.Gotify |
|
15 | { |
16 | { |
|
Line 31... | Line 32... | |||
31 | |
32 | |
|
Line 32... | Line 33... | |||
32 | private Task _runTask; |
33 | private Task _runTask; |
|
Line -... | Line 34... | |||
- | 34 | |
||
- | 35 | private ClientWebSocket _webSocketClient; |
||
- | 36 | |
||
- | 37 | private readonly Server _server; |
||
- | 38 | |
||
- | 39 | public GotifyConnection(Server server) |
||
- | 40 | { |
||
33 | |
41 | _server = server; |
|
Line 34... | Line 42... | |||
34 | private ClientWebSocket _webSocketClient; |
42 | } |
|
Line 35... | Line 43... | |||
35 | |
43 | |
|
Line 91... | Line 99... | |||
91 | { |
99 | { |
|
92 | if (_cancellationTokenSource != null) |
100 | if (_cancellationTokenSource != null) |
|
93 | { |
101 | { |
|
94 | _cancellationTokenSource.Cancel(); |
102 | _cancellationTokenSource.Cancel(); |
|
95 | } |
103 | } |
|
- | 104 | |
||
- | 105 | _runTask.Wait(CancellationToken.None); |
||
96 | } |
106 | } |
|
Line 97... | Line 107... | |||
97 | |
107 | |
|
Line 98... | Line 108... | |||
98 | #endregion |
108 | #endregion |
|
Line 138... | Line 148... | |||
138 | if (gotifyNotification == null) |
148 | if (gotifyNotification == null) |
|
139 | { |
149 | { |
|
140 | continue; |
150 | continue; |
|
141 | } |
151 | } |
|
Line -... | Line 152... | |||
- | 152 | |
||
- | 153 | gotifyNotification.Server = _server; |
||
142 | |
154 | |
|
143 | if (!Uri.TryCreate($"{httpUri}/application", UriKind.Absolute, out var applicationUri)) |
155 | if (!Uri.TryCreate($"{httpUri}/application", UriKind.Absolute, out var applicationUri)) |
|
144 | { |
156 | { |
|
145 | continue; |
157 | continue; |