1# testsuite_network_helper section for BASIC256
2
3# Modification History
4# date		programmer	description
5# 20140530	j.m.reneau	original Coding
6
7####
8#### this program must be started in a second instance
9#### of BASIC256 on the same machine when prompted by
10#### the interactive networking test
11####
12
13# start by setting up a simple server waiting on port 9999
14# wait for a string and echo it back with ++ added
15# at the front and end
16# keep echoing until the word end is sent from other process
17
18print "wait for connection on " + netaddress()
19n = freenet
20print "network connection " + n
21netlisten n, 9999
22print "got connection"
23do
24   while not netdata(n)
25      pause .1
26      print ".";
27   end while
28   n$ = netread(n)
29   print n$
30   netwrite n, "++" + n$ + "++"
31until n$ = "end"
32netclose
33
34print "you may now close this window"
35end