public async Task Close()

in src/Azure.AppService.Tunnel/Tunnel/WebSockets/WebSocketConnection.cs [74:85]


    public async Task Close(WebSocketCloseStatus closeStatus, string statusDescription)
    {
        await Task.WhenAny(SendCloseRequest(), Task.Delay(500));
        _lifetimeDefinition.Terminate();
        return;

        Task SendCloseRequest()
        {
            var message = new CloseOutgoingMessage(_webSocket, closeStatus, statusDescription);
            return _asyncWritesProcessor.QueueAndAwaitCompletion(message);
        }
    }