diff --git a/index.js b/index.js index 5610885..8bd0e0b 100644 --- a/index.js +++ b/index.js @@ -4,19 +4,6 @@ const fs = require('fs'); const client = new net.Socket(); fs.readFile('to_send.txt', 'utf8', (err, data) => { - if (err) { - console.error('Error reading file:', err); - } else { - const to_send = data; - client.connect(2000, '127.0.0.1', () => { - console.log('Connected'); - client.write(to_send); - client.end(); // Закрываем соединение после отправки данных - -setTimeout(() => { - - -fs.readFile('to_send2.txt', 'utf8', (err, data) => { if (err) { console.error('Error reading file:', err); } else { @@ -30,19 +17,6 @@ fs.readFile('to_send2.txt', 'utf8', (err, data) => { }); -}, 10) - - - - - }); - } -}); - - - - - client.on('close', () => { console.log('Connection closed'); });