R
R
RootKeet2015-07-09 17:48:46
Node.js
RootKeet, 2015-07-09 17:48:46

Buffer object Node.JS?

Until all that is

var net = require("net");
var crc = require("crc");

var svr = net.createServer(function(socket){
  console.log("Connected: "+socket.remoteAddress+":"+socket.remotePort);
  socket.on("data", function(data){
    console.log(data);
    var result = crc.crc16modbus(data);
    console.log(result);
  });
  socket.on("end", socket.end);
});
var svraddr = "185.20.225.164";
var svrport = 7654;
svr.listen(svrport,svraddr);
console.log("Server Created at "+svraddr+":"+svrport+"\n");

I don’t understand what the piece of iron sends me
and what is the Buffer object in the socket.on function

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2015-07-09
@k12th

Representing binary data in nodejs: https://nodejs.org/api/buffer.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question