@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
20 lines • 589 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUnnamedSocketName = getUnnamedSocketName;
exports.sendMessage = sendMessage;
const json_1 = require("../../../util/json");
/**
* Produce a new name for an unnamed socket connection
*/
function getUnnamedSocketName(c) {
return `${c.remoteAddress ?? '?'}@${c.remotePort ?? '?'}`;
}
/**
* Sends a message to the given socket
*/
function sendMessage(c, message) {
return (0, json_1.superBigJsonStringify)(message, '\n', msg => {
c.write(msg);
});
}
//# sourceMappingURL=send.js.map