File: testsuite_network_helper.kbs

package info (click to toggle)
basic256 2.0.0.11-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 15,076 kB
  • sloc: cpp: 16,791; yacc: 3,979; lex: 1,446; makefile: 25
file content (35 lines) | stat: -rwxr-xr-x 830 bytes parent folder | download | duplicates (4)
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
26
27
28
29
30
31
32
33
34
35
# testsuite_network_helper section for BASIC256

# Modification History
# date		programmer	description
# 20140530	j.m.reneau	original Coding

####
#### this program must be started in a second instance
#### of BASIC256 on the same machine when prompted by
#### the interactive networking test
####

# start by setting up a simple server waiting on port 9999
# wait for a string and echo it back with ++ added
# at the front and end
# keep echoing until the word end is sent from other process

print "wait for connection on " + netaddress()
n = freenet
print "network connection " + n
netlisten n, 9999
print "got connection"
do
   while not netdata(n)
      pause .1
      print ".";
   end while
   n$ = netread(n)
   print n$
   netwrite n, "++" + n$ + "++"
until n$ = "end"
netclose 

print "you may now close this window"
end