Files
Nim/tests/stdlib/tnetconnect.nim
ringabout f89ba2c951 add default field support for object in ARC/ORC (#20480)
* fresh start

* add cpp target

* add result support

* add nimPreviewRangeDefault

* reduce

* use orc

* refactor common parts

* add tuple support

* add testcase for tuple

* cleanup; fixes nimsuggest tests

* there is something wrong with cpp

* remove

* add support for seqs

* fixes style

* addd initial distinct support

* remove links

* typo

* fixes tuple defaults

* add rangedefault

* add cpp support

* fixes one more bugs

* add more hasDefaults

* fixes ordinal types

* add testcase for #16744

* add testcase for #3608

* fixes docgen

* small fix

* recursive

* fixes

* cleanup and remove tuple support

* fixes nimsuggest

* fixes generics procs

* refactor

* increases timeout

* refactor hasDefault

* zero default; disable i386

* add tuples back

* fixes bugs

* fixes tuple

* add more tests

* fix one more bug regarding tuples

* more tests and cleanup

* remove messy distinct types which must be initialized by original types

* add tests

* fixes zero default

* fixes grammar

* fixes tests

* fixes tests

* fixes tests

* fixes comments

* fixes and add testcase

* undo default values for results

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2022-10-04 12:45:10 +02:00

29 lines
664 B
Nim

discard """
disabled: "i386"
matrix: "-d:ssl"
"""
import std/net
from std/strutils import `%`
# bug #15215
proc test() =
let ctx = newContext()
proc fn(url: string) =
let socket = newSocket()
defer: close(socket)
connect(socket, url, Port(443), 5000) # typically 20 could be enough
send(socket, "GET / HTTP/1.0\nHost: $#\nConnection: close\n\n" % [url])
wrapSocket(ctx, socket)
# trying 2 sites makes it more resilent: refs #17458 this could give:
# * Call to 'connect' timed out. [TimeoutError]
# * No route to host [OSError]
try:
fn("www.nim-lang.org")
except TimeoutError, OSError:
fn("www.google.com")
test()