aboutsummaryrefslogtreecommitdiffstats
path: root/guide
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-08-26 19:08:38 +0200
committerLoïc Hoguin <[email protected]>2013-08-26 19:08:38 +0200
commit5347bd3335f45f244f82e5f10da3993d9fdc56a3 (patch)
tree28f79c3d5554ef2cb898dfe8cd751a63a62cb2c5 /guide
parente176953cd095e8c65d56461f840a14d53c57a1c1 (diff)
downloadgun-5347bd3335f45f244f82e5f10da3993d9fdc56a3.tar.gz
gun-5347bd3335f45f244f82e5f10da3993d9fdc56a3.tar.bz2
gun-5347bd3335f45f244f82e5f10da3993d9fdc56a3.zip
Add gun:open/2
Diffstat (limited to 'guide')
-rw-r--r--guide/connect.md14
1 files changed, 8 insertions, 6 deletions
diff --git a/guide/connect.md b/guide/connect.md
index 147edf3..5655d66 100644
--- a/guide/connect.md
+++ b/guide/connect.md
@@ -13,16 +13,18 @@ server. Because of this, the connection must be initiated
before being able to send any request.
The process that creates the connection is also known as the
-owner of the connection. Only this process can perform operations
-on the connection, and only this process will receive messages
-from the connection.
+owner of the connection, or the controlling process.. Only
+this process can perform operations on the connection, and
+only this process will receive messages from the connection.
-To open a new connection, the `gun:open/3` function can be used.
+To open a new connection, the `gun:open/{2,3}` function can be used.
``` erlang
-{ok, Pid} = gun:open("twitter.com", 443, []).
+{ok, Pid} = gun:open("twitter.com", 443).
```
+Gun will by default assume that SSL should be used.
+
The connection is managed by a separate process and is supervised
by the Gun supervisor directly.
@@ -41,7 +43,7 @@ nature of Gun, we only need to create a monitor once when
the connection is established.
``` erlang
-{ok, Pid} = gun:open("twitter.com", 443, []).
+{ok, Pid} = gun:open("twitter.com", 443).
MRef = monitor(process, Pid).
```