home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: Java
/
Java.zip
/
nrs100.zip
/
Submit.nrx
< prev
Wrap
Text File
|
1999-06-29
|
1KB
|
46 lines
-- Submit.nrx 1.0
--
--
class Submit
method main(args=String[]) public static
arg=rexx(args)
parse arg filename
if filename = '' then exit
server= 'localhost'
port = 8080
do
say 'Connecting to NRServer at address "'server'" on port "'port'"'
clientSocket = Socket(server, port)
-- output to server over socket
out = PrintWriter(OutputStreamWriter(clientSocket.getOutputStream()))
-- input from server over socket
in = BufferedReader(InputStreamReader(clientSocket.getInputStream()))
-- send filename to server and flush the socket
out.printLn(filename)
out.flush()
-- Read response from server
line=String(in.readline())
loop while line \= null
say line
line = in.readline()
end -- loop while
catch e=IOException
say 'IOException (' e ') caught:\n' e.getMessage()
end -- while line
exit 0