Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: net/data/websocket/count-connection_wsh.py

Issue 390773002: [WebSocket] Send a close frame when the renderer process is gone. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/data/websocket/connect_check.html ('k') | net/data/websocket/count_connection.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 numOpenConnections = 0
6 numClosedConnections = 0
7
8
9 def web_socket_do_extra_handshake(request):
10 global numOpenConnections
11 numOpenConnections += 1
12
13
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()
19
20
21 def web_socket_passive_closing_handshake(request):
22 global numOpenConnections
23 global numClosedConnections
24 numOpenConnections -= 1
25 numClosedConnections += 1
26 return (1000, '')
OLDNEW
« no previous file with comments | « net/data/websocket/connect_check.html ('k') | net/data/websocket/count_connection.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698