Removed the resend left for debugging the TSC printer.
This commit is contained in:
parent
963c42a845
commit
31d2be28c5
26
index.js
26
index.js
@ -4,19 +4,6 @@ const fs = require('fs');
|
|||||||
const client = new net.Socket();
|
const client = new net.Socket();
|
||||||
|
|
||||||
fs.readFile('to_send.txt', 'utf8', (err, data) => {
|
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) {
|
if (err) {
|
||||||
console.error('Error reading file:', err);
|
console.error('Error reading file:', err);
|
||||||
} else {
|
} else {
|
||||||
@ -30,19 +17,6 @@ fs.readFile('to_send2.txt', 'utf8', (err, data) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}, 10)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
client.on('close', () => {
|
client.on('close', () => {
|
||||||
console.log('Connection closed');
|
console.log('Connection closed');
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user