Friday, September 6, 2013

Java - Sending data to a server trough netcat

Java - Sending data to a server trough netcat

I Already know how to send some data through netcat with unix shell.
Infact I have something like this:
#!/bin/bash
set -e
while true; do
java someCodeThatPrintsSomeData
sleep 60
done | nc -w 30 127.0.0.1 4242
What I want to do is to use netcat directly inside Java, instead of call
the java program inside the shell. I found something on the web but
finally I don't understand how to use Netcat in Java, and if it's
possible.
so the question: How can I use Netcat inside Java?

No comments:

Post a Comment