add hash/kvs-client

This commit is contained in:
King
2024-05-25 14:23:43 +00:00
parent ea5291f3fe
commit 480bccfa04
16 changed files with 1100 additions and 28 deletions

26
kvs-client/js-kvstore.js Executable file
View File

@@ -0,0 +1,26 @@
const net = require('net');
const client = net.createConnection({ port: 2000, host: '192.168.243.131' }, () => {
console.log('connect kvstore');
client.write('GET Teacher');
});
client.on('data', (data) => {
console.log(`recv${data.toString()}`);
client.end();
});
client.on('error', (err) => {
console.error('connect failed', err);
});
client.on('close', () => {
console.log('close connection');
});