Düğüm sunucumuz var, Bu sunucu diğer taraf TCP sunucusuyla bir tcp soket bağlantısı oluşturur. Ben tcp veri boru çalışıyorum ama ikinci kez bir mesaj alındığında ben aynı akış içinde hem yeni mesaj hem de bir öncekini (ilk) aldım. Bunu nasıl düzeltebilirim?Node.js Socket pipe son paket
var net = require('net');
var HOST = '127.0.0.1'; // parameterize the IP of the Listen
var PORT = 6969; // TCP LISTEN port
net.createServer(function(sock) {
console.log('CONNECTED: ' + sock.remoteAddress + ':' + sock.remotePort);
sock.on('data', function(data) {
sock.write(data);
socket.pipe(socket);
});
sock.on('close', function(data) {
console.log('CLOSED: ' + sock.remoteAddress + ' ' + sock.remotePort);
});
}).listen(PORT, HOST);
Neler gerçekte burada yapmaya çalışıyorsunuz? – mscdex