Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function connect(options = {}, callback) {
if (!isDuplexStream(options.socket)) {
options.socket = unicast.createSocket(options);
}
const socket = new Socket(options);
socket.connect(callback);
return socket;
}