3 # Quick, down and dirty test of bsProxy server using loopbacks.
5 # Hard coded message format:
24 # 25 fval 68 65 6c 6c 6f 20 30 20 66 72
25 # 6f 6d 20 6c 6f 6f 70 62 61 63
26 # 6b 2e 73 68 0a = "hello 0 from loopback.sh\n"
33 REQ_LOOPBACK='\x00\x03'
35 FIXED="${REQ_LOOPBACK}\x01"
45 cdata="hello ${cnt} from loopback.sh" # loop this back
46 let len=${#cdata}+1 # length including newline
47 flen="\x"$(printf "%02x" ${len}) # hex field length
49 tid="\x"$(printf "%02x" ${cnt}) # hex tid
50 let len=3+3+${len} # total body length
51 blen="\x00\x"$(printf "%02x" ${len}) # hex body length
53 hdr="${MAGIC}${tid}${HND_SERVER}${REQ_LOOPBACK}${blen}"
54 body="${FIXED}${FID}${FTYPE}${flen}${cdata}"
56 echo -e "${hdr}${body}" >&3
59 #printf "msgid=0x%02x, tid=%u, blen=%u: " ${line:0:1} ${line:1:1} ${line:2:1}
63 done 3<>/dev/tcp/127.0.0.1/9195