Questions tagged [dgrams]

dgrams is a Node.JS library for sending and receiving UDP datagrams.

For detailed help, see UDP / Datagram Sockets | Node.js Documentation

22 questions
6
votes
1 answer

How to send a UDP packet via dgram in Nodejs?

I tried various versions of Nodejs' datagram socket module's send function: var dgram = require('dgram'); var client = dgram.createSocket('udp4'); client.send('Hello World!',0, 12, 12000, '127.0.0.1', function(err, bytes)…
Gergely
  • 6,879
  • 6
  • 25
  • 35
2
votes
1 answer

UDP pinger timeout in javascript dgram node

So, for a course i'm taking, we're coding a UDP pinger in Javascript, using Node.js and Dgram. We've been given the following assignment: Create the client code for an application. Your client should send 10 ping messages to the target UDP server.…
Honeybun
  • 85
  • 1
  • 8
1
vote
1 answer

.Net Socket SendTo command not Receiving via UDP on a Raspberry Pi 4 running Buster

I'm using a shared class library (private, not a public one) that has a method that searches local networks for a Manufacturers Test box in order to commission the device my software is running on. I am running a .Net 6 application on a Raspberry Pi…
nbren007
  • 313
  • 1
  • 4
  • 14
1
vote
1 answer

Node JS App crashes with ERR_SOCKET_CANNOT_SEND error

I have a node js service that consumes messages from Kafka and processes it through various steps of transformation logic. During the processing, services use Redis and mongo for storage and caching purposes. In the end, it sends the transformed…
Pancham Kumar
  • 145
  • 1
  • 10
1
vote
0 answers

react-native-udp Packet not sent until other packets are received

I'm using react-native-udp for a real Time application in react native. But application after send a few packets, stops sending packets. Because it can't receive some packets. and may be because of the port in use. I can't set timeout for receiving…
B.B
  • 21
  • 3
1
vote
1 answer

Cannot send multiple UDP messages in node js

I am trying to understand dgram with a small example of client/server. However, it seems that I can only send 1 message per run of the client. If I try to send multiple messages like in below client code, nothing gets sent. Server code: var PORT =…
user846016
  • 400
  • 5
  • 10
0
votes
0 answers

Spoofing the source ip and port of a udp packet among local applications

I have a whitelist that stands between my server and my clients. I want my clients to connect to my server through my whitelist. The point of my whitelist is to ignore any UDP packets that does not have a whitelisted source. If they are in the…
Mr.Grease
  • 197
  • 1
  • 13
0
votes
0 answers

Redirecting UDP traffic with dgram in Node

I have a node app that I want to use as a whitelist for a server of mine. My server accepts udp messages. What I want to do is have some sort of white list that only allows specific ip's to reach the server. I've written a rest api that can add…
Mr.Grease
  • 197
  • 1
  • 13
0
votes
1 answer

Checksum XOR calculation in JavaScript

I'm building and UDP server to communicate with GPS devices. It's built in node using dgram. I have this data to calculate its checksum: >RGP261222120013-3520041-05908923000176700DF4400;ID=4718;#44E6;*24< GPS device manual says something like…
leandronn
  • 173
  • 1
  • 17
0
votes
0 answers

Send Data to every client connected in dgram server

I've been struggling with this for the past few days, I've been looking for a way to send data to every connected client to my UDP node.js server. var dgram = require("dgram"); var port = 3000; var server = dgram.createSocket("udp4"); var sockets…
0
votes
0 answers

nodejs - Can someone explain what is being printed to my console?

So I've setup a nodejs environment to run some code on my local machine. I'm using the datagram module to listen to a particular port number and udp address. See below for my code. import dgram from 'node:dgram'; //USER INPUT. be sure to update…
0
votes
0 answers

Can't make a bot speak using Discord's websocket

This is my code: const WebSocket = require('ws'); const dgram = require('dgram'); const fs = require('fs'); function start(token, guild, endpoint, id, session) { console.log(token, guild, endpoint, id, session); console.log('Connecting to…
MegaPower
  • 1
  • 2
0
votes
1 answer

Multiple multicast bidirectionally on a single machine using two instances

I am trying to use node:dgram to multicast bidirectionally on a single machine using two instances. -----------PC----------- send message / ........../\.......... \ receive message receive message \ ........./..\......... /…
Dshiz
  • 3,099
  • 3
  • 26
  • 53
0
votes
0 answers

dgram NodeJS sending datagram to specific IP in LAN

Problem: I can't figure out how to correctly use Node.js and dgram to send a UDP packet to a specific IP address within the same LAN (not behind a NAT) Attempted Solution I found Send Broadcast datagram showcasing how to use dgram with Node.js to…
0
votes
1 answer

Binding socket before send with dgram in client

I am developing a node.js program that connects over UDP with another program running on the same machine. Currently I am sending data like this: import dgram = require("dgram"); const client = dgram.createSocket("udp4"); //Some code to structure…
1
2