Last active
June 19, 2018 11:29
-
-
Save frnkst/528db7db52dddbfa41b14ba0235919b3 to your computer and use it in GitHub Desktop.
M2
This file contains 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
function sendPacket() { | |
port++; | |
if (tries >= 3) { | |
tries = 0; | |
ttl++; | |
} | |
tries++; | |
udpSocket.setTTL(ttl); | |
startTime = process.hrtime(); | |
udpSocket.send(new Buffer(''), 0, 0, port, DESTINATION_IP, function (err) { | |
if (err) throw err; | |
timeout = setTimeout(handleReply, MAX_TIMEOUT_IN_MILLISECONDS); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment