Raw socket - sends command gets response
do -- ready to process
say 'Connecting to server:' server '(port:' port')'
mysocket = Socket(server, port) -- actual connect
say 'Requesting:' str -- what we want
say
-- output: send
out = PrintWriter(OutputStreamWriter(mysocket.getOutputStream()))
-- input: receive
in = BufferedReader(InputStreamReader(mysocket.getInputStream()))
out.printLn(str) -- send our requeststring
out.flush() -- needed on some platforms !
And the URL wrapper on a socket. This one downloads a zip file.
method mammoth(urlName=Rexx) static signals MalformedURLException,FileNotFoundException,IOException
urln=URL(urlName)
outfilename = String "\\output.zip"
outdata = DataOutputStream(FileOutputStream(outfilename))
in = BufferedInputStream(urln.openStream())
instream = DataInputStream(in)
loop forever
onebyte = instream.readByte()
outdata.writeByte(onebyte)
catch e=EOFException
say e.getMessage()
in.close()
end
outdata.close()
return
________________________________________
From:
[hidden email] [
[hidden email]] on behalf of Earl Hodil [
[hidden email]]
Sent: Sunday, August 12, 2012 10:01 AM
To:
[hidden email]
Subject: [Ibm-netrexx] NetRexx Socket Example
Where can one find NetRexx stream sockets examples?
Earl
_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive :
http://ibm-netrexx.215625.n3.nabble.com/_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive :
http://ibm-netrexx.215625.n3.nabble.com/