tcp-client
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -11,6 +11,6 @@ var moment = require('moment') | ||
this.timeout = this.options.timeout | ||
} | ||
var logInfo = function(tramaReq,tramaRes) { | ||
logger.info(moment(new Date()).format('DD/MM/YYYY/HH:mm:ss.SSS') +' (REQUEST) ' +tramaReq); | ||
@@ -22,3 +22,3 @@ logger.info(moment(new Date()).format('DD/MM/YYYY/HH:mm:ss.SSS') +' (RESPONSE)' +tramaRes); | ||
var client = net.connect({host:this.ip,port:this.port}, () => { | ||
client.write(trama+'\r\n'); | ||
client.write(trama+'\n'); | ||
}) | ||
@@ -28,3 +28,3 @@ | ||
client.on('data', function(data){ | ||
client.on('data', function(data) { | ||
buffer = Buffer.concat([buffer, new Buffer(data, 'utf-8')]); | ||
@@ -34,3 +34,3 @@ client.end(); | ||
client.on('end', function(data){ | ||
client.on('end', function(data) { | ||
logInfo (trama,buffer.toString()) | ||
@@ -40,3 +40,3 @@ callback(null,buffer.toString()) | ||
client.on('error', function(err){ | ||
client.on('error', function(err) { | ||
callback(err,null) | ||
@@ -43,0 +43,0 @@ }); |
{ | ||
"name": "tcp-client", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "small client tcp", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4095