Hex Artifact Content

Artifact f1f90a46699bdd29c141399aa747e323b5f0d253712b332baffb481fea733080:


0000: 54 68 69 73 20 64 69 72 65 63 74 6f 72 79 20 63  This directory c
0010: 6f 6e 74 61 69 6e 20 65 78 61 6d 70 6c 65 20 66  ontain example f
0020: 69 6c 65 73 20 66 6f 72 20 68 6f 77 20 74 6f 20  iles for how to 
0030: 75 73 65 20 74 68 65 20 54 4c 53 20 70 61 63 6b  use the TLS pack
0040: 61 67 65 20 74 6f 20 70 65 72 66 6f 72 6d 0a 63  age to perform.c
0050: 6f 6d 6d 6f 6e 20 66 75 6e 63 74 69 6f 6e 73 2e  ommon functions.
0060: 20 54 68 65 73 65 20 61 72 65 20 6a 75 73 74 20   These are just 
0070: 61 20 66 65 77 20 6f 66 20 74 68 65 20 70 6f 73  a few of the pos
0080: 73 69 62 69 6c 69 74 69 65 73 2e 0a 0a 67 65 74  sibilities...get
0090: 73 5f 62 6c 6f 63 6b 69 6e 67 5f 6e 6f 5f 76 61  s_blocking_no_va
00a0: 72 69 61 62 6c 65 2e 74 63 6c 0a 44 6f 77 6e 6c  riable.tcl.Downl
00b0: 6f 61 64 20 61 20 77 65 62 70 61 67 65 20 75 73  oad a webpage us
00c0: 69 6e 67 20 67 65 74 73 2c 20 6e 6f 20 76 61 72  ing gets, no var
00d0: 69 61 62 6c 65 20 61 72 67 2c 20 61 6e 64 20 62  iable arg, and b
00e0: 6c 6f 63 6b 69 6e 67 20 49 2f 4f 2e 0a 0a 67 65  locking I/O...ge
00f0: 74 73 5f 62 6c 6f 63 6b 69 6e 67 5f 77 69 74 68  ts_blocking_with
0100: 5f 76 61 72 69 61 62 6c 65 2e 74 63 6c 0a 44 6f  _variable.tcl.Do
0110: 77 6e 6c 6f 61 64 20 61 20 77 65 62 70 61 67 65  wnload a webpage
0120: 20 75 73 69 6e 67 20 67 65 74 73 2c 20 76 61 72   using gets, var
0130: 69 61 62 6c 65 20 61 72 67 2c 20 61 6e 64 20 62  iable arg, and b
0140: 6c 6f 63 6b 69 6e 67 20 49 2f 4f 2e 0a 0a 67 65  locking I/O...ge
0150: 74 73 5f 6e 6f 6e 62 6c 6f 63 6b 69 6e 67 5f 6e  ts_nonblocking_n
0160: 6f 5f 76 61 72 69 61 62 6c 65 2e 74 63 6c 0a 44  o_variable.tcl.D
0170: 6f 77 6e 6c 6f 61 64 20 61 20 77 65 62 70 61 67  ownload a webpag
0180: 65 20 75 73 69 6e 67 20 67 65 74 73 2c 20 6e 6f  e using gets, no
0190: 20 76 61 72 69 61 62 6c 65 20 61 72 67 2c 20 61   variable arg, a
01a0: 6e 64 20 6e 6f 6e 2d 62 6c 6f 63 6b 69 6e 67 20  nd non-blocking 
01b0: 49 2f 4f 2e 0a 0a 67 65 74 73 5f 6e 6f 6e 62 6c  I/O...gets_nonbl
01c0: 6f 63 6b 69 6e 67 5f 77 69 74 68 5f 76 61 72 69  ocking_with_vari
01d0: 61 62 6c 65 2e 74 63 6c 0a 44 6f 77 6e 6c 6f 61  able.tcl.Downloa
01e0: 64 20 61 20 77 65 62 70 61 67 65 20 75 73 69 6e  d a webpage usin
01f0: 67 20 67 65 74 73 2c 20 76 61 72 69 61 62 6c 65  g gets, variable
0200: 20 61 72 67 2c 20 61 6e 64 20 6e 6f 6e 2d 62 6c   arg, and non-bl
0210: 6f 63 6b 69 6e 67 20 49 2f 4f 2e 0a 0a 68 74 74  ocking I/O...htt
0220: 70 5f 67 65 74 5f 66 69 6c 65 2e 74 63 6c 0a 44  p_get_file.tcl.D
0230: 6f 77 6e 6c 6f 61 64 20 61 20 77 65 62 70 61 67  ownload a webpag
0240: 65 20 75 73 69 6e 67 20 74 68 65 20 68 74 74 70  e using the http
0250: 20 70 61 63 6b 61 67 65 2e 0a 0a 68 74 74 70 5f   package...http_
0260: 67 65 74 5f 77 65 62 70 61 67 65 2e 74 63 6c 0a  get_webpage.tcl.
0270: 44 6f 77 6e 6c 6f 61 64 20 61 20 66 69 6c 65 20  Download a file 
0280: 75 73 69 6e 67 20 74 68 65 20 68 74 74 70 20 70  using the http p
0290: 61 63 6b 61 67 65 2e 0a 20 0a 68 74 74 70 5f 67  ackage.. .http_g
02a0: 65 74 5f 77 65 62 70 61 67 65 5f 70 72 6f 78 79  et_webpage_proxy
02b0: 2e 74 63 6c 0a 44 6f 77 6e 6c 6f 61 64 20 61 20  .tcl.Download a 
02c0: 66 69 6c 65 20 75 73 69 6e 67 20 74 68 65 20 68  file using the h
02d0: 74 74 70 20 61 6e 64 20 61 75 74 6f 70 72 6f 78  ttp and autoprox
02e0: 79 20 70 61 63 6b 61 67 65 73 2e 0a 0a 72 65 61  y packages...rea
02f0: 64 5f 62 6c 6f 63 6b 69 6e 67 5f 77 65 62 70 61  d_blocking_webpa
0300: 67 65 2e 74 63 6c 0a 44 6f 77 6e 6c 6f 61 64 20  ge.tcl.Download 
0310: 61 20 77 65 62 70 61 67 65 20 75 73 69 6e 67 20  a webpage using 
0320: 72 65 61 64 20 61 6e 64 20 62 6c 6f 63 6b 69 6e  read and blockin
0330: 67 20 49 2f 4f 2e 0a 0a 72 65 61 64 5f 6e 6f 6e  g I/O...read_non
0340: 62 6c 6f 63 6b 69 6e 67 5f 77 65 62 70 61 67 65  blocking_webpage
0350: 2e 74 63 6c 0a 44 6f 77 6e 6c 6f 61 64 20 61 20  .tcl.Download a 
0360: 77 65 62 70 61 67 65 20 75 73 69 6e 67 20 72 65  webpage using re
0370: 61 64 20 61 6e 64 20 6e 6f 6e 2d 62 6c 6f 63 6b  ad and non-block
0380: 69 6e 67 20 49 2f 4f 2e 0a 0a                    ing I/O...