diff options
author | John Dupuy <john@cattailcreek9.com> | 2020-08-22 05:00:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-22 11:00:38 +0100 |
commit | 66eba3388aacba20c49b925c9c700f988fb9e5d0 (patch) | |
tree | 3c1047b710c72345f36303383d535ed984173091 /lib/pure | |
parent | 8a004e2fc07c87b8308c3c03e4448372a2094383 (diff) | |
download | Nim-66eba3388aacba20c49b925c9c700f988fb9e5d0.tar.gz |
Added more SSL documentation to `net` module. (#15206)
* Added more SSL documentation to `net` module. * Changed two of the net.nim doc refs to links. * Update lib/pure/net.nim doc wording. Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com> * Update lib/pure/net.nim - added space to doc URI Co-authored-by: alaviss <leorize+oss@disroot.org> * Fixed another doc URI in net module. * For net module doc added warning to connect procedure. * Update net.nim Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com> Co-authored-by: alaviss <leorize+oss@disroot.org>
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/net.nim | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/pure/net.nim b/lib/pure/net.nim index ea1c86c31..239e3e9f6 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -20,7 +20,9 @@ ## ==== ## ## In order to use the SSL procedures defined in this module, you will need to -## compile your application with the ``-d:ssl`` flag. +## compile your application with the ``-d:ssl`` flag. See the +## `newContext<net.html#newContext%2Cstring%2Cstring%2Cstring%2Cstring%2Cstring>`_ +## procedure for additional details. ## ## Examples ## ======== @@ -36,9 +38,17 @@ ## var socket = newSocket() ## socket.connect("google.com", Port(80)) ## +## For SSL, use the following example (and make sure to compile with ``-d:ssl``): +## +## .. code-block:: Nim +## var socket = newSocket() +## var ctx = newContext() +## wrapSocket(ctx, socket) +## socket.connect("google.com", Port(443)) +## ## UDP is a connectionless protocol, so UDP sockets don't have to explicitly -## call the ``connect`` procedure. They can simply start sending data -## immediately. +## call the `connect <net.html#connect%2CSocket%2Cstring>`_ procedure. They can +## simply start sending data immediately. ## ## .. code-block:: Nim ## var socket = newSocket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) @@ -1942,6 +1952,10 @@ proc connect*(socket: Socket, address: string, port = Port(0), ## ## The ``timeout`` parameter specifies the time in milliseconds to allow for ## the connection to the server to be made. + ## + ## **Warning:** This procedure appears to be broken for SSL connections as of + ## Nim v1.0.2. Consider using the other `connect` procedure. See + ## https://github.com/nim-lang/Nim/issues/15215 for more info. socket.fd.setBlocking(false) socket.connectAsync(address, port, socket.domain) |