ksky #7574(2008/09/05 17:24 GMT) [ Groovy ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
try { host = args[0] port = args[1].toInteger() } catch (e) { println "usage: groovy ${this.class.name} host port" System.exit 1 } new Socket(host, port).withStreams { is, os -> dis = new DataInputStream(is) buf = new byte[1024] while ((len = System.in.read(buf)) >= 0) { os.write(buf, 0, len) dis.readFully(buf, 0, len) System.out.write(buf, 0, len) } }
Rating0/0=0.00-0+
[ reply ]
ksky #7574() [ Groovy ] Rating0/0=0.00
try { host = args[0] port = args[1].toInteger() } catch (e) { println "usage: groovy ${this.class.name} host port" System.exit 1 } new Socket(host, port).withStreams { is, os -> dis = new DataInputStream(is) buf = new byte[1024] while ((len = System.in.read(buf)) >= 0) { os.write(buf, 0, len) dis.readFully(buf, 0, len) System.out.write(buf, 0, len) } }Rating0/0=0.00-0+
[ reply ]