Skip to content

Commit

Permalink
fix exception on node 9
Browse files Browse the repository at this point in the history
A new argument is necessary to the TCPWrap constructor
due to nodejs/node#17157
  • Loading branch information
jhiesey committed Jan 31, 2018
1 parent 66cdf9c commit 2729473
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions client.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
var Handle = require('./handle')
var TCP = process.binding('tcp_wrap').TCP
var TCPConnectWrap = process.binding('tcp_wrap').TCPConnectWrap
var TCPWrap = process.binding('tcp_wrap')
var TCPConnectWrap = TCPWrap.TCPConnectWrap
var pull = require('pull-stream')
var net = require('net')

module.exports = function (port, address, cb) {
cb = cb || function () {}
port |= 0
var clientHandle = new TCP()
var clientHandle = TCPWrap.constants ? new TCPWrap.TCP(TCPWrap.constants.SOCKET) : new TCPWrap.TCP()
var connect = new TCPConnectWrap()
var stream

Expand Down
4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
var TCP = process.binding('tcp_wrap').TCP
var TCPWrap = process.binding('tcp_wrap')
var net = require('net')
var Handle = require('./handle')

function noop () {}

module.exports = function (onConnect) {
var server = new TCP()
var server = TCPWrap.constants ? new TCPWrap.TCP(TCPWrap.constants.SERVER) : new TCPWrap.TCP()

return {
listen: function (port, addr, cb) {
Expand Down

0 comments on commit 2729473

Please sign in to comment.