From 5e05fe8e7877ffd6bc473b77b8ca0a12ad26bd67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 14 Mar 2024 16:23:56 +0100 Subject: Cowboy 2.12, Cowlib 2.13, Gun 2.1 --- docs/en/gun/2.1/manual/gun.shutdown/index.html | 201 +++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 docs/en/gun/2.1/manual/gun.shutdown/index.html (limited to 'docs/en/gun/2.1/manual/gun.shutdown/index.html') diff --git a/docs/en/gun/2.1/manual/gun.shutdown/index.html b/docs/en/gun/2.1/manual/gun.shutdown/index.html new file mode 100644 index 00000000..6e4e0339 --- /dev/null +++ b/docs/en/gun/2.1/manual/gun.shutdown/index.html @@ -0,0 +1,201 @@ + + + + + + + + + + Nine Nines: gun:shutdown(3) + + + + + + + + + + + + + + + +
+
+
+
+ +

gun:shutdown(3)

+ +

Name

+

gun:shutdown - Gracefully close the connection

+

Description

+
+
shutdown(ConnPid) -> ok
+
+ConnPid :: pid()
+
+

Gracefully close the connection.

+

Gun will wait for up to closing_timeout milliseconds before brutally closing the connection. The graceful shutdown mechanism varies between the different protocols:

+
  • For HTTP/1.1 there is no such mechanism and Gun will close the connection once the current response is received. Any pipelined requests are immediately terminated. +
  • +
  • For HTTP/2 Gun will send a GOAWAY frame and wait for the existing streams to terminate. +
  • +
  • For Websocket Gun will send a close frame and wait for the server's close frame before closing the connection. +
  • +
+

The function returns immediately. The connection may therefore still be up for some time after this call.

+

Gun will not attempt to reconnect once graceful shutdown has been initiated.

+

Arguments

+
ConnPid
+

The pid of the Gun connection process.

+
+
+

Return value

+

The atom ok is returned.

+

Changelog

+
  • 2.0: Function introduced. +
  • +
+

Examples

+
Gracefully shutdown the connection
+
+
ok = gun:shutdown(ConnPid).
+
+

See also

+

gun(3), gun:open(3), gun:open_unix(3), gun:close(3)

+ + + + + + +
+ +
+ + +

+ Gun + 2.1 + Function Reference + +

+ + + +

Navigation

+ +

Version select

+ + +

Like my work? Donate!

+

Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:

+
+ + + + + + + + + +

Recurring payment options are also available via GitHub Sponsors. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.

+ + + +
+
+
+
+ + + + + + + + + -- cgit v1.2.3