Punt
A small layer on top of node's core UDP module to make fast volatile messaging even simpler. Punt uses the tiny AMP prototol to serialize buffer, string, and json arguments.
Installation
$ npm install punt
Example
A small in-proc example of a server with three clients:
var punt = ;var server = punt;var a = punt;var b = punt;var c = punt; server; ; ; ;
yielding:
<Buffer 68 65 6c 6c 6f>
hello world
{ hello: 'world' }
<Buffer 68 65 6c 6c 6f>
hello world
{ hello: 'world' }
...
API
Server(addr)
Bind to the given addr
.
Client(addr)
Connect to the given addr
.
Client#send(...)
Send one or more arguments a single atomic message. The following types are supported through AMP:
- strings
- buffers
- objects (serialized as JSON)
License
MIT