Initial commit

This commit is contained in:
xl1034 2024-10-27 23:42:21 +07:00
commit 963c42a845
3 changed files with 108 additions and 0 deletions

59
.idea/workspace.xml Normal file
View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="b271f68d-d304-4d0c-ab4b-4137075c0644" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ComposerSettings">
<execution />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 8
}</component>
<component name="ProjectId" id="2lKLmlkNTznQ00gh95czvP95i6D" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;D:/Develop/TCP_SEND_DATA&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-js-predefined-1d06a55b98c1-0b3e54e931b4-JavaScript-PS-241.17011.119" />
<option value="bundled-php-predefined-ba97393d7c68-48a1a656d44e-com.jetbrains.php.sharedIndexes-PS-241.17011.119" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="b271f68d-d304-4d0c-ab4b-4137075c0644" name="Changes" comment="" />
<created>1724923982430</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1724923982430</updated>
<workItem from="1724923983446" duration="1344000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
</project>

48
index.js Normal file
View File

@ -0,0 +1,48 @@
const net = require('net');
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 {
const to_send = data;
client.connect(2000, '127.0.0.1', () => {
console.log('Connected');
client.write(to_send);
client.end(); // Закрываем соединение после отправки данных
});
}
});
}, 10)
});
}
});
client.on('close', () => {
console.log('Connection closed');
});

1
to_send.txt Normal file
View File

@ -0,0 +1 @@
è014126240067463921dedbcc9324cd è01412624006746392178e1b19324cd è014126240067463921e3983c9324cd è0141262400674639214c8a0f9324cd è0141262400674639215c59789324cd è014126240067463921a2cb689324cd