home *** CD-ROM | disk | FTP | other *** search
- /*
- client for the ds service, see ds.rexx
- */
-
- l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then call err "rmh.library not found",1
- if AddLibrary("rexxsupport.library","rxsocket.library")~=0 then call err result "not found",1
-
- sin.addrport = 10000
- sin.addraddr = "127.0.0.1"
-
- sock = socket("INET","STREAM")
- if sock<0 then call err "can't create socket"
-
- if connect(sock,"SIN")<0 then call err "can't connect"
-
- request = "A"
- if send(sock,request)~=1 then call err "send error"
-
- res=recv(sock,"BUF",256)
- if res<0 then call err "recv error"
- if res=0 then call err "connection closed",1
- else say buf
-
- exit
- /***************************************************************************/
- err: procedure expose prg
- parse arg msg,ntdoerr
- if ntdoerr~=1 then msg = msg "("ErrorString(errno())")"
- say msg
- exit
- /***************************************************************************/
-