osc-js | OSC library for Node.js , Electron , Chrome Apps | Websocket library
kandi X-RAY | osc-js Summary
kandi X-RAY | osc-js Summary
OSC library for Node.js, Electron, Chrome Apps, Webpages or any other JS application. It comes with a customizable Plugin API for WebSocket, UDP or bridge networking
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Prepare address to given address string
- Preprocesses regular expression
- Build default options
- String - > String
- generate type tag
- Initialize the plugins .
- merge options with default options
- Create a DataView instance .
- Check if named property has been defined
- Is Blob Array
osc-js Key Features
osc-js Examples and Code Snippets
Community Discussions
Trending Discussions on osc-js
QUESTION
I'm using node dgram to send OSC messages to a device. The device sends its responses to the port where the request came from (I can't change this).
Now my problem is that I don't know which port dgram will use to send the message, so I can't bind the UDP socket to listen to the correct port for the response.
Is there any way to force dgram to send from a pre-determined port everytime?
Edit: added code
...ANSWER
Answered 2019-Jun-18 at 18:00Is there any way to force dgram to send from a pre-determined port everytime?
Just bind the UDP socket to the port (and IP) you want to use as the source port. When you then call send
or sendto
on this socket it will use the address (IP+port) you've bound to as the source address. Then you can call recv
or recvfrom
on the same socket to get the response.
EDIT - after seeing the actual code:
the problem is that you've created another UDP socket for sending. Instead you should use the socket which is already bound on the address and port not only for receiving but also for sending.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install osc-js
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page