From 5347bd3335f45f244f82e5f10da3993d9fdc56a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 26 Aug 2013 19:08:38 +0200 Subject: Add gun:open/2 --- guide/connect.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'guide') 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). ``` -- cgit v1.2.3