aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/ranch.get_port.asciidoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/manual/ranch.get_port.asciidoc')
-rw-r--r--doc/src/manual/ranch.get_port.asciidoc44
1 files changed, 44 insertions, 0 deletions
diff --git a/doc/src/manual/ranch.get_port.asciidoc b/doc/src/manual/ranch.get_port.asciidoc
new file mode 100644
index 0000000..0de4a3a
--- /dev/null
+++ b/doc/src/manual/ranch.get_port.asciidoc
@@ -0,0 +1,44 @@
+= ranch:get_port(3)
+
+== Name
+
+ranch:get_port - Get the listening port
+
+== Description
+
+[source,erlang]
+----
+get_port(Ref :: ranch:ref())
+ -> Port :: inet:port_number()
+----
+
+Get the listening port.
+
+This function is particularly useful to retrieve the
+listening port number when it was not provided in the
+options and was chosen randomly instead.
+
+== Arguments
+
+Ref::
+
+The listener name.
+
+== Return value
+
+The listening port is returned.
+
+== Examples
+
+.Get the listening port
+[source,erlang]
+----
+Port = ranch:get_port(example).
+----
+
+== See also
+
+link:man:ranch:start_listener(3)[ranch:start_listener(3)],
+link:man:ranch:get_addr(3)[ranch:get_addr(3)],
+link:man:ranch:info(3)[ranch:info(3)],
+link:man:ranch(3)[ranch(3)]