Created
February 24, 2011 17:17
-
-
Save sivy/842482 to your computer and use it in GitHub Desktop.
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
| (wr)tt:[~]> ./test.js | |
| test | |
| /Users/steve/test.js:12 | |
| throw err; | |
| ^ | |
| TypeError: Bad file descriptor argument | |
| at Socket.sendto (dgram.js:259:25) | |
| at dgram.js:246:14 | |
| at dgram.js:40:5 | |
| at dns.js:159:33 | |
| at IOWatcher.callback (dns.js:53:15) | |
| (wr)tt:[~]> |
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
| #!/usr/local/bin/node | |
| console.log ("test\n"); | |
| var dgram = require('dgram'); | |
| var message = new Buffer('node_test.stat|c'); | |
| var client = dgram.createSocket('udp4'); | |
| client.send(message, 0, message.length, 8125, 'rayners.org', | |
| function (err, bytes) { | |
| if (err) { | |
| throw err; | |
| } | |
| console.log("Wrote " + bytes + " bytes to socket."); | |
| }); | |
| client.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment