---
name: "ns_atclose"
section: "3aolserver"
platform: "linux"
package: "aolserver4-dev"
version: "4.5.1-18.1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/ns_atclose"
---

# ns\_atclose(3aolserver)

Facilities to register a script callback.

```

```

## NAME

ns\_atclose, ns\_atexit, ns\_atshutdown, ns\_atsignal - Facilities to register a script callback.

## SYNOPSIS

```
ns_atclose script
ns_atexit script
ns_atshutdown script
ns_atsignal script
```

```

```

## DESCRIPTION

These commands register a callback to execute a later time.  The callbacks are executed once in the context of the current Tcl interpreter.

- **ns\_atclose** *script*

  Invoke given script when the current connection is closed. The callback can be registered within the Tcl interpreter associated with the current HTTP connection; if no connection exists, and error is returned.

- **ns\_atexit** *script*

  Invoke given script before the AOLserver exists after all virtual servers have stopped.

- **ns\_atshutdown** *script*

  Invoke given script when the current virtual server is shutdown during AOLserver exit.

- **ns\_atsignal** *script*

  Invoke given script when a SIGHUP signal is received in the main startup thread of the AOLserver.

## SEE ALSO

ns\_shutdown(n), ns\_kill(n)

## KEYWORDS

shutdown, callback
