mirror of https://github.com/lukechilds/node.git
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.
17 lines
536 B
17 lines
536 B
8 years ago
|
'use strict';
|
||
|
const common = require('../common');
|
||
|
const dgram = require('dgram');
|
||
|
const socket = dgram.createSocket('udp4');
|
||
|
const lookup = socket._handle.lookup;
|
||
|
|
||
|
// Test the scenario where the socket is closed during a bind operation.
|
||
|
socket._handle.bind = common.mustNotCall('bind() should not be called.');
|
||
|
|
||
|
socket._handle.lookup = common.mustCall(function(address, callback) {
|
||
|
socket.close(common.mustCall(() => {
|
||
|
lookup.call(this, address, callback);
|
||
|
}));
|
||
|
});
|
||
|
|
||
|
socket.bind(common.mustNotCall('Socket should not bind.'));
|