Makes callback optional on close.

This commit is contained in:
Stephen Whitmore 2016-04-21 15:56:38 -07:00
parent c456326515
commit b43f6ffb6f

View File

@ -68,7 +68,7 @@ function TCP () {
var count = 0
listeners.forEach((listener) => {
listener.close(() => {
if (++count === listeners.length) {
if (++count === listeners.length && callback) {
callback()
}
})