2.0.3 • Published 7 years ago

octo-sansa v2.0.3

Weekly downloads
8
License
MIT
Repository
github
Last release
7 years ago

octo-sansa

CI Status Version License

A very simple TCP (client/server) messaging layer

Getting started

A simple "echo" server:

const octo = require('octo-sansa');

const server = octo.createServer();

server.on('connected', client => {
  client.on('echo', (body, callback) => {
    console.log('Client said', body);
    callback(undefined, body);
  });
});

server.listen(1234, () => {
  console.log('Server listening on ' + server.address().port);
});

A simple "echo" client:

const octo = require('octo-sansa');

const client = octo.createClient(1234, 'localhost');

client.on('connect', () => {
  client.ask('echo', 'Say hello server', (err, response) => {
    console.log('The server said', response);
    client.close();
  });
});

TODO

Documentation of the API.

2.0.3

7 years ago

2.0.2

8 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago