MCPcopy Index your code
hub / github.com/coder/code-server / canConnect

Function canConnect

src/node/util.ts:450–459  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

448 * Return a promise that resolves with whether the socket path is active.
449 */
450export function canConnect(path: string): Promise<boolean> {
451 return new Promise((resolve) => {
452 const socket = net.connect(path)
453 socket.once("error", () => resolve(false))
454 socket.once("connect", () => {
455 socket.destroy()
456 resolve(true)
457 })
458 })
459}
460
461export const isFile = async (path: string): Promise<boolean> => {
462 try {

Callers 3

canConnectMethod · 0.90
findFreeSocketPathMethod · 0.90

Calls 2

resolveFunction · 0.85
onceMethod · 0.80

Tested by

no test coverage detected