Socket Device Examples

This section contains examples on Socket Device usage.

	;server.m
	Set portno=6321,delim=$c(13)
	Set tcpdev="server$"_$j,timeout=30
	Open tcpdev:(ZLISTEN=portno_":TCP":attach="server"):timeout:"SOCKET"
	Use tcpdev
	Write /listen(1)
	Write /wait(timeout)
	;
	;dialogue with the client
	;

	;client.m
	Set host="orlando"
	Set portno=6321
	Set delim=$c(13)
	Set tcpdev="client$"_$j,timeout=30
	O
	tcpdev:(connect=host_":"_portno_":TCP":attach="client"):timeout:"SOCKET"
	Use tcpdev
	;
	;dialogue with the server
	;