INNER CODE UNIT · JavaScript
instanceEndpoint
sebastiancarlos/beachpatrol · beachmsg.js:24
const instanceEndpoint = (socketName) =>
isWindows
? String.raw`\\.\pipe\beachpatrol-${socketName}`
: `${SOCKET_DIR}/${socketName}.sock`;
// Error thrown by sendCommand. `kind` classifies the failure
// "timeout" the server accepted but never finished within timeout
// "error" the server replied with an error (sentinel line)
// "dead" the socket cannot be reached
class CommandError extends Error {
constructor(kind, message) {
super(message);
this.kind = kind;
}
}
// Connect to an instance endpoint, send a command, and stream the output