mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
add error listener to test-net-pingpong
This commit is contained in:
1 parent
9b67962a44
commit
462a8f8652
1 file changed
+10
@@ -35,7 +35,12 @@ function pingPongTest (port, host) {
|
||||
socket.close();
|
||||
});
|
||||
|
||||
socket.addListener("error", function (e) {
|
||||
throw e;
|
||||
});
|
||||
|
||||
socket.addListener("close", function () {
|
||||
puts('server socket closed');
|
||||
assert.equal(false, socket.writable);
|
||||
assert.equal(false, socket.readable);
|
||||
socket.server.close();
|
||||
@@ -78,10 +83,15 @@ function pingPongTest (port, host) {
|
||||
});
|
||||
|
||||
client.addListener("close", function () {
|
||||
puts('client closed');
|
||||
assert.equal(N+1, count);
|
||||
assert.equal(true, sent_final_ping);
|
||||
tests_run += 1;
|
||||
});
|
||||
|
||||
client.addListener("error", function (e) {
|
||||
throw e;
|
||||
});
|
||||
});
|
||||
|
||||
server.listen(port, host);
|
||||
|
||||
Reference in new issue
Block a user