0.0.13 • Published 6 years ago

centralio v0.0.13

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Centralio

Centralio is a library for creating applications with many clients and a central server based on the UDP protocol.

Build Status Maintainability Test Coverage

Get Starded

If you want use Centralio simply add dependency into your project

$ npm install centralio

Your first server

// file: server.js
// exec: node server
const server = require('centralio').server();

// Start your server 
server.start('127.0.0.1', '44044');

// Handle received messages from client
server.rx(function(client, msg) {
  console.log('Message from client:', client.id, msg);  
  // Respond to client
  client.tx('Thanks from your message.');
});

Your first client

// file: client.js
// exec: node client
const client = require('centralio').client();

// Start your client
client.start('127.0.0.1', '44044');

// Handle received message from server
client.rx(function(msg) {
  console.log('Message from server:', msg);    
});

// Send message to server
client.tx('Hi my server!');

Manage client state

Centralio Client/Server sample architecture

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago