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

Side by Side Diff: net/data/websocket/multiple-connections.html

Issue 436493002: Handle multiple simultanous wss: connections. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use a pointer instead of a reference to scoped_ptr. 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
OLDNEW
(Empty)
1 <title>WebSocket is not subject to HTTP(S) connection limit</title>
2 <script>
3 var protocol = location.protocol.replace('http', 'ws');
4 var url = protocol + '//' + location.host + '/echo-with-no-extension';
5
6 // TODO(ricea): The limit for ws: is 255, but wss: gets a limit of 30
7 // (per-host:port, not ip:port!) because it still uses the HTTP pool code. This
8 // should be fixed at some point. When it is, change this number back to 50 (or
9 // even larger, if it works).
10 var socketCount = 30;
11 var connected = 0;
12
13 for (i = 0; i < socketCount; ++i) {
14 var ws = new WebSocket(url);
15 ws.onopen = function() {
16 ++connected;
17 if (connected == socketCount) {
18 document.title = "PASS";
19 }
20 };
21 ws.onclose = function() {
22 document.title = "FAIL";
23 };
24 }
25
26 setTimeout(function() {
27 console.log("Got stuck after " + connected + " socket(s) connected");
28 document.title = "FAIL";
29 }, 5000);
30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698