udpcomm
Provide a simple hub-like UPD datagram communication mechanism for NodeJs
This module includes 2 class:
- UDPShoutor - send and receive messages from other shouters
- UDPHub - a hub mechanism to distribute message from shouters
Install
Install the module with:
npm install udpcomm
Usage
// fire up the udp hub { var UDPHub server; UDPHub = UDPHub; server = 9999; serverstart; }; // in another process, run the shouter { var PORT UDPShoutor channelId onMessage shoutor; UDPShoutor = UDPShoutor; PORT = 9999; channelId = 5; { return console; }; shoutor = PORT channelId onMessage; ; }; // in third process, run the same shouter// and you will see how it work
License
Copyright (c) 2014 Yi Licensed under the MIT license.