You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
631 B

'use strict';
require('../common');
const assert = require('assert');
const dgram = require('dgram');
const socket = dgram.createSocket('udp4');
const errorMessage =
/^Error: Send takes "offset" and "length" as args 2 and 3$/;
assert.throws(() => {
socket.sendto();
}, errorMessage);
assert.throws(() => {
socket.sendto('buffer', 1, 'offset', 'port', 'address', 'cb');
}, errorMessage);
assert.throws(() => {
socket.sendto('buffer', 'offset', 1, 'port', 'address', 'cb');
}, errorMessage);
assert.throws(() => {
socket.sendto('buffer', 1, 1, 10, false, 'cb');
}, /^Error: udp4 sockets must send to port, address$/);