0.0.13 • Published 8 years ago

centralio v0.0.13

Weekly downloads
3
License
MIT
Repository
github
Last release
8 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

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago