It assumes the highest positive signed 32-bit float value for numbers.
In other words, 2147483647 (or 0x7FFFFFFF or 2^31-1).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var udp = require('dgram'); | |
| // --------------------creating a udp server -------------------- | |
| // creating a udp server | |
| var server = udp.createSocket('udp4'); | |
| // emits when any error occurs | |
| server.on('error',function(error){ | |
| console.log('Error: ' + error); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Chat</title> | |
| <script src="./socket.io/socket.io.js"></script> | |
| <script type="text/javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // The events are from https://www.w3.org/TR/html5/semantics-embedded-content.html#media-elements-event-summary | |
| import videojs from 'video.js' | |
| const Plugin = videojs.getPlugin('plugin') | |
| const EVENTS = [ | |
| 'loadstart', | |
| 'progress', | |
| 'suspend', | |
| 'abort', | |
| 'error', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // EXAMINE THE DOCUMENT OBJECT // | |
| // console.dir(document); | |
| // console.log(document.domain); | |
| // console.log(document.URL); | |
| // console.log(document.title); | |
| // //document.title = 123; | |
| // console.log(document.doctype); | |
| // console.log(document.head); | |
| // console.log(document.body); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const net = require('net'); | |
| // | |
| // A Node.js port of this original Gist: https://gist.github.com/danielfaust/998441 | |
| // To find hosts on the network: nmap -Pn -p55000 192.168.12.1/24 | |
| // | |
| // Note: This is for Samsung TVs circa 2012-2015 that use a service running on port 55000 | |
| // Samsung TV's circa 2016 and later use a WebSocket service on port 8001 which is different | |
| // |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.
Source: tutorialspoint.com