Skip to content

Commit

Permalink
workaround for issue-11
Browse files Browse the repository at this point in the history
  • Loading branch information
wupl committed Nov 11, 2020
1 parent 62cd9a2 commit f008c5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/tcpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ module.exports = function (debug, cb) {
this.client = net.connect(self._unixSocket || { host: this._address, port: this._port })
this.client._send = _send
this.client.write = write // override
setInterval(() => {
this.client.resume();
}, 50);
if (self._encoding) this.client.setEncoding(self._encoding)

if (this._timeout) this.client.setTimeout(this._timeout)
Expand Down
3 changes: 3 additions & 0 deletions lib/tcpServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module.exports = function (debug) {
}

function tcpConnection (socket) {
setInterval(() => {
socket.resume();
}, 50);
/* override write to dump Hex */
socket.write = function (chunk, encoding, cb) {
if (typeof chunk !== 'string' && !(chunk instanceof Buffer)) {
Expand Down

0 comments on commit f008c5d

Please sign in to comment.