comport="com1" crlf=chr(13)&chr(10) openport (comport,9600,8,n,1) openssrv (8090) again: repeat tcp=readsock () posofcrlf=pos (crlf,tcp) until (posofcrlf<>0) luntcp=len (tcp) #Extract IP, port and query tcp=del (tcp,luntcp-1,2) posofspace=pos (" ",tcp) IP=mid (tcp,1,posofspace-1) tcp=del (tcp,1,posofspace+1) posofspace=pos (" ",tcp) port=mid (tcp,1,posofspace-1) lunport=len (port) query=del (tcp,1,lunport+1) #Extraction done send (comport,query) repeat serial=receive (comport) posofcrlf=pos (crlf,serial) until (posofcrlf<>0) writesock (IP,port,serial) flush (comport) flushsock () goto again