deleteServerHandle function

void deleteServerHandle(
  1. ServerHandle handle
)

Deletes a handle's files — used after a failed connect, the same "on the way past" cleanup attachToLiveSession does.

Implementation

void deleteServerHandle(ServerHandle handle) {
  for (var path in [handle.handlePath, handle.socketPath]) {
    if (path == null) continue;
    try {
      File(path).deleteSync();
    } on FileSystemException {
      // Somebody else swept it first; that was the goal.
    }
  }
}