Mercurial
annotate third_party/libuv/docs/code/multi-echo-server/hammer.js @ 268:f7b1188d5fb1
support repo rules Copilot bundle path
Match both +_repo_rules2+ and +http_archive+ Copilot CLI repository layouts during deployment and production startup.
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Fri, 07 Aug 2026 13:02:41 -0700 |
| parents | 948de3f54cea |
| children |
| rev | line source |
|---|---|
| 160 | 1 var net = require('net'); |
| 2 | |
| 3 var PHRASE = "hello world"; | |
| 4 var write = function(socket) { | |
| 5 socket.write(PHRASE, 'utf8'); | |
| 6 } | |
| 7 | |
| 8 for (var i = 0; i < 1000; i++) { | |
| 9 (function() { | |
| 10 var socket = net.connect(7000, 'localhost', function() { | |
| 11 socket.on('data', function(reply) { | |
| 12 if (reply.toString().indexOf(PHRASE) != 0) | |
| 13 console.error("Problem! '" + reply + "'" + " '" + PHRASE + "'"); | |
| 14 else | |
| 15 write(socket); | |
| 16 }); | |
| 17 write(socket); | |
| 18 }); | |
| 19 })(); | |
| 20 } |