Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
server.listen(shepherd._net.port, function (err) {
if (err)
deferred.reject(err);
else
deferred.resolve(server);
});
if (shepherd._config.connectionType === 'udp6') {
coap.globalAgentIPv6 = new coap.Agent({
type: shepherd._config.connectionType,
socket: server._sock
});
shepherd._agent = coap.globalAgentIPv6;
} else {
coap.globalAgent = new coap.Agent({
type: shepherd._config.connectionType,
socket: server._sock
});
shepherd._agent = coap.globalAgent;
}
return deferred.promise.nodeify(callback);
};