File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed
src/Transports.Subscriptions.WebSockets Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -42,26 +42,28 @@ public void LinkTo(ITargetBlock<OperationMessage> target)
42
42
43
43
public async Task Complete ( WebSocketCloseStatus closeStatus , string statusDescription )
44
44
{
45
- if ( _socket . State != WebSocketState . Closed &&
46
- _socket . State != WebSocketState . CloseSent &&
47
- _socket . State != WebSocketState . Aborted )
48
- try
45
+ try
46
+ {
47
+ if ( _socket . State != WebSocketState . Closed &&
48
+ _socket . State != WebSocketState . CloseSent &&
49
+ _socket . State != WebSocketState . Aborted )
49
50
{
50
51
if ( closeStatus == WebSocketCloseStatus . NormalClosure )
51
52
await _socket . CloseAsync (
52
- closeStatus ,
53
- statusDescription ,
54
- CancellationToken . None ) ;
53
+ closeStatus ,
54
+ statusDescription ,
55
+ CancellationToken . None ) ;
55
56
else
56
57
await _socket . CloseOutputAsync (
57
- closeStatus ,
58
- statusDescription ,
59
- CancellationToken . None ) ;
60
- }
61
- finally
62
- {
63
- _startBlock . Complete ( ) ;
58
+ closeStatus ,
59
+ statusDescription ,
60
+ CancellationToken . None ) ;
64
61
}
62
+ }
63
+ finally
64
+ {
65
+ _startBlock . Complete ( ) ;
66
+ }
65
67
}
66
68
67
69
public Task Completion => _endBlock . Completion ;
You can’t perform that action at this time.
0 commit comments