Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-dgram-setTTL.js « parallel « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 88627a314c384819361a30466fbb4a415c90a491 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'use strict';
const common = require('../common');
const assert = require('assert');
const dgram = require('dgram');
const socket = dgram.createSocket('udp4');

socket.bind(common.PORT);
socket.on('listening', function() {
  var result = socket.setTTL(16);
  assert.strictEqual(result, 16);

  assert.throws(function() {
    socket.setTTL('foo');
  }, /Argument must be a number/);

  socket.close();
});