summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/websockets/handlers/passive-close-abort_wsh.py
blob: ac3f67c8db17f2cfe796431249525bfdf5c435f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright (c) 2024 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""
Wait for a Close frame from the client and then close the connection without
sending a Close frame in return.
"""

from mod_pywebsocket.handshake import AbortedByUserException


def web_socket_do_extra_handshake(request):
    pass


def web_socket_transfer_data(request):
    while True:
        if request.ws_stream.receive_message() is None:
            return


def web_socket_passive_closing_handshake(request):
    raise AbortedByUserException('abrupt close')