Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

224
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda