Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / net / data / websocket / count-connection_wsh.py
blobaa1659c692fd5ddf186faf98587f8d7244ca70b7
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.
5 numOpenConnections = 0
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)
17 # Just waiting...
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
26 return (1000, '')