1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 numClosedConnections
= 0
9 def web_socket_do_extra_handshake(request
):
10 global numOpenConnections
11 numOpenConnections
+= 1
14 def web_socket_transfer_data(request
):
15 request
.ws_stream
.send_message('open: %d, closed: %d' %
16 (numOpenConnections
, numClosedConnections
), binary
=False)
18 request
.ws_stream
.receive_message()
21 def web_socket_passive_closing_handshake(request
):
22 global numOpenConnections
23 global numClosedConnections
24 numOpenConnections
-= 1
25 numClosedConnections
+= 1