Skip to content

Commit

Permalink
Remove pointless tcp-ping
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners committed Jun 16, 2016
1 parent bf02457 commit b038a67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
20 changes: 5 additions & 15 deletions lib/TcpConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const net = require('net')
const backoff = require('backoff')
const tcping = require('tcp-ping')

/**
* @prop {string} [address] The host address to connect to. Default: `127.0.0.1`.
Expand Down Expand Up @@ -61,20 +60,11 @@ function TcpConnection (options) {
this.connecting = true
this.socket = net.createConnection(
{host: this.options.address, port: this.options.port},
() => tcping.probe(
this.options.address,
this.options.port,
(err, result) => {
this.connecting = false
if (err) {
console.error(err.message, null)
if (cb) cb(err)
return
}
this.connected = result
if (cb) cb(null, this.connected)
}
)
() => {
this.connecting = false
this.connected = true
if (cb) cb(null, this.connected)
}
)
addListeners.call(this)
}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"pump": "^1.0.1",
"safe-buffer": "^5.0.1",
"split2": "^2.0.1",
"tcp-ping": "^0.1.1",
"through2": "^2.0.1"
}
}

0 comments on commit b038a67

Please sign in to comment.