connect

avios/avprogs/connect · 391 B

From the archive avios151.tar.gz

Download the archive   « Back to the archive contents

# This demonstrates how to use the connect command. 

proc main
var line pid sock fd

colour off
set sock [connect "localhost" 21]
set fd [open to write "/dev/tty"]

spawn pid
if pid
	# Get data from server.
	in sock
	input line
	while [not $eof]
		printnl line;  input line
	wend
	exit 0
endif

# Get user input and send to server.
out sock
while 1
	input line;  printnl line
wend
endproc

Site Stats

Snippets: 1791
Codebases: 571