Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

225
Vistas
Separating Buffer Data That isn't in the Same Row

I have an Socket in node.js. I send 3 different data to my server. But my 2 and 3 datas are going together to server.

My Socket server code is:

var net = require("net");
const server = new net.Server()

server.on("connection", (client) => {
  client.on("data", (data) => {
    console.log(data)
  })
})

server.listen(5000)

My Socket client code is:

var net = require("net");
const client = new net.Socket()

client.connect({ host: "localhost", port: 5000 }, () => {
  console.log("Client Connected !");
  client.write(Buffer.from([0x82, 0x80, 0x09, 0xf6, 0x9f, 0x00, 0x04, 0x73, 0x65, 0x66, 0x61, 0x00]))
  client.write(Buffer.from([0x30, 0x08, 0x00, 0x04, 0x73, 0x65, 0x66, 0x61, 0x61, 0x73]))
  client.write(Buffer.from([0x30, 0x08, 0x00, 0x04, 0x73, 0x65, 0x66, 0x61, 0x61, 0x73]))
});

When I run this codes, Appear in server console like this below

1 .row -> <Buffer 82 80 09 f6 9f 00 04 73 65 66 61 00>
2. row -> <Buffer 30 08 00 04 73 65 66 61 61 73 30 08 00 04 73 65 66 61 61 73>

That you see in 2. row, client datas come to server together. How can I solve this problem.Thanks

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda