8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37ed05b commit 86a3bd0Copy full SHA for 86a3bd0
test/parallel/test-tls-inception.js
@@ -12,8 +12,7 @@ var fs = require('fs');
12
var path = require('path');
13
var net = require('net');
14
15
-var options, a, b, portA, portB;
16
-var gotHello = false;
+var options, a, b;
17
18
var body = new Buffer(4000).fill('A');
19
@@ -43,10 +42,6 @@ b = tls.createServer(options, function(socket) {
43
42
socket.end(body);
44
});
45
46
-process.on('exit', function() {
47
- assert(gotHello);
48
-});
49
-
50
a.listen(common.PORT, function() {
51
b.listen(common.PORT + 1, function() {
52
options = {
@@ -62,15 +57,14 @@ a.listen(common.PORT, function() {
62
57
63
58
ssl.setEncoding('utf8');
64
59
var buf = '';
65
- ssl.once('data', function(data) {
60
+ ssl.on('data', function(data) {
66
61
buf += data;
67
- gotHello = true;
68
69
- ssl.on('end', function() {
+ ssl.on('end', common.mustCall(function() {
70
assert.equal(buf, body);
71
ssl.end();
72
a.close();
73
b.close();
74
- });
+ }));
75
76