Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

udp-messenger

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

udp-messenger

Send messages over udp in small chunks

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

#UDP Messenger This is a library to send messages over udp. Messages are broken into chunks and reorganized on the other side. There is a loose detection of failures and messages will attempt to resend themselves upon failure.

const Messenger = require('udp-messenger')

let messenger = new Messenger(2000, 54000, 512) // timeout, port, packet size (must be greater than 26 bytes)
messenger.on('message', (msg)=>{}) // when a message is received
messenger.on('listening', ()=>{}) //when a messenger begins listening
messenger.on('error', (err)=>{}) // when an error occurs
messenger.on('sent', (msg)=>{}) // when a message is sent
messenger.on('failure', (msg)=>{}) // when a failure to receive a message occurs
messenger.on('dropped', (msg)=>{}) // when a message cannot be resent
messenger.listen()// start listening for messages
messenger.send(new Buffer("Hello World!") , '192.168.1.3', 52000) //send a message (buffer, host, port)
messenger.close(()=>{}) // stop listening

##license ISC

Keywords

FAQs

Package last updated on 24 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc