tcp-client
Advanced tools
Comparing version 1.0.8 to 1.0.9
11
index.js
@@ -6,6 +6,17 @@ var Client = require('./lib') | ||
} | ||
console.log('TCP-CONEXION') | ||
var options ={} | ||
options.ip="172.18.20.166" | ||
options.port=9098 | ||
options.timeout=5000 | ||
//console.log(options) | ||
cliente = new Client(options) | ||
cliente.request('03100700000000000000000205201616:08:15.182 002', function(err,result){ | ||
if(err) console.log(err) | ||
console.log(result) | ||
}) | ||
module.exports = { | ||
createClient: createClient | ||
} |
@@ -20,4 +20,8 @@ var moment = require('moment') | ||
Client.prototype.request = function(trama, callback) { | ||
console.log('trama envio..') | ||
console.log(this.ip) | ||
console.log(this.port) | ||
var client = net.connect({host:this.ip,port:this.port}, () => { | ||
var tramaSend = trama + '\r\n' | ||
console.log( tramaSend) | ||
client.write(tramaSend); | ||
@@ -41,3 +45,3 @@ }) | ||
}); | ||
/* | ||
client.setTimeout(this.timeout, function(msg) { | ||
@@ -47,2 +51,3 @@ | ||
}) | ||
*/ | ||
} | ||
@@ -49,0 +54,0 @@ |
{ | ||
"name": "tcp-client", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"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
51610
7
89