• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ThreeMammals / Ocelot / 14794531460

02 May 2025 11:42AM UTC coverage: 85.804% (+0.05%) from 85.75%
14794531460

Pull #2091

github

14d423
web-flow
Merge 98c11bb37 into e78fe42fd
Pull Request #2091: #930 Try to close WebSocket destination when state is Open or CloseReceived

14 of 18 new or added lines in 2 files covered. (77.78%)

9 existing lines in 3 files now uncovered.

5464 of 6368 relevant lines covered (85.8%)

4991.39 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
src/Ocelot/WebSockets/ClientWebSocketProxy.cs
1
using System.Net.WebSockets;
2

3
namespace Ocelot.WebSockets;
4

5
public class ClientWebSocketProxy : WebSocket, IClientWebSocket
6
{
7
    // RealSubject (Service) class of Proxy design pattern
8
    private readonly ClientWebSocket _realService;
9
    private readonly IClientWebSocketOptions _options;
10

11
    public ClientWebSocketProxy()
×
12
    {
13
        _realService = new ClientWebSocket();
×
14
        _options = new ClientWebSocketOptionsProxy(_realService.Options);
×
UNCOV
15
    }
×
16

17
    // ClientWebSocket implementations
18
    public IClientWebSocketOptions Options => _options;
×
19

20
    public Task ConnectAsync(Uri uri, CancellationToken cancellationToken)
21
        => _realService.ConnectAsync(uri, cancellationToken);
×
22

23
    // WebSocket implementations
24
    public override WebSocketCloseStatus? CloseStatus => _realService.CloseStatus;
×
25

26
    public override string CloseStatusDescription => _realService.CloseStatusDescription;
×
27

28
    public override WebSocketState State => _realService.State;
×
29

30
    public override string SubProtocol => _realService.SubProtocol;
×
31

32
    public override void Abort() => _realService.Abort();
×
33

34
    public override Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken)
35
        => _realService.CloseAsync(closeStatus, statusDescription, cancellationToken);
×
36

37
    public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken)
38
        => _realService.CloseOutputAsync(closeStatus, statusDescription, cancellationToken);
×
39

40
    public override void Dispose() => _realService.Dispose();
×
41

42
    public override Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byte> buffer, CancellationToken cancellationToken)
43
        => _realService.ReceiveAsync(buffer, cancellationToken);
×
44

45
    public override Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken)
46
        => _realService.SendAsync(buffer, messageType, endOfMessage, cancellationToken);
×
47

UNCOV
48
    public WebSocket ToWebSocket() => _realService;
×
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc