---
title: "disconnect · RUAL Documentation"
description: "Closes sockets: the run's, a session's or every socket of a user, after an optional last push. A RUAL realtime block. See its pins and version history."
canonical: https://docs.rual.nl/block-types/realtime/realtime_disconnect
language: en
---

# disconnect

This block is part of the [`realtime`](https://docs.rual.nl/block-types/realtime) group and was last modified in core [`v15.0.2`](https://docs.rual.nl/core-versions/150002).

Closes sockets: the run's, a session's or every socket of a user, after an optional last push.

- flow

- reason `value`

- last push method `value`

- last push payload `object`

- close code `number`

- close text `value`

- session `value` A session id. Without session or user: the socket of the run.

- user `value` A user guid: every session of the user, on any node.

- flow

- success `condition`

- error `value`

Closes after the frames already queued, the last push included. close_code 0 (the default) closes the way the entity's realtime_codec closes a kick (by default a close frame, 1000 "disconnected"; a codec can drop the connection without one, for clients that expect that after a sign-out or a ban); a negative close_code drops the connection without a close frame; any other code, such as 4001 or 1012, sends a close frame with close_text first.

## Version history

Introduced in [`v15.0.2`](https://docs.rual.nl/core-versions/150002).

- [`v15.0.2`](https://docs.rual.nl/core-versions/150002): block added in this release.

- [Back to `realtime`](https://docs.rual.nl/block-types/realtime): Return to the main group to view all sub-groups

- [Back to `realtime`](https://docs.rual.nl/block-types/realtime?group=realtime): Return to the group to view all blocks within this group
