File: netgetmany.kbs

package info (click to toggle)
basic256 0.9.6.69a-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 26,304 kB
  • sloc: cpp: 7,778; yacc: 926; lex: 575; sh: 21; makefile: 7
file content (25 lines) | stat: -rw-r--r-- 543 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# open 5 network connections at once
dim a$(5)
dim t$(5)

a$ = { "www.google.com", "www.yahoo.com", "www.cnn.com", "www.espn.com", "www.basic256.org"}

for t = 0 to 4
   NETCONNECT t, a$[t], 80
   print t + " connected to " + a$[t]
next t
for t = 0 to 4
   NETWRITE t, "GET HTTP/1.1" + chr(13) + chr(10) + chr(13) + chr(10)
   print t + " request written"
next t
for t = 0 to 4
   t$[t] = NETREAD(t)
   print t + " read"
next t
for t = 0 to 4
   print t + " " + left(t$[t],40)
next t
for t = 0 to 4
   netclose t
   print t + " closed"
next t