N
neuneudr
Hi all,
is it possible to have a Java app listen on a socket (?)
and be *instantly* notified when a remote shell script
netcats something on that socket?
I have control on the exact number of bytes sent by
netcat. Say the shell script does this:
echo "something" | netcat 10.0.0.39 3423
And I've got a Java app configured to 'listen' on
socket 3423, can I be instantly notified when the
9 letters of "something" have been netcat'ed.
Imagine, out of simplicity (?) that it's always
exactly the same number of bytes that are going
to be sent by netcat and that netcat shall work
in TCP mode.
What should I do on the Java side? Which class
should I use and how can I do so that I don't need
to 'poll' the socket but be instantly notified when
something arrives on the socket? (it has to work
on Java 5).
It is maybe a dumb question but I've got no idea
as to how Java application listen on sockets and
how they're supposed to act when something comes
on the socket.
Any explanation greatly appreciated : )
is it possible to have a Java app listen on a socket (?)
and be *instantly* notified when a remote shell script
netcats something on that socket?
I have control on the exact number of bytes sent by
netcat. Say the shell script does this:
echo "something" | netcat 10.0.0.39 3423
And I've got a Java app configured to 'listen' on
socket 3423, can I be instantly notified when the
9 letters of "something" have been netcat'ed.
Imagine, out of simplicity (?) that it's always
exactly the same number of bytes that are going
to be sent by netcat and that netcat shall work
in TCP mode.
What should I do on the Java side? Which class
should I use and how can I do so that I don't need
to 'poll' the socket but be instantly notified when
something arrives on the socket? (it has to work
on Java 5).
It is maybe a dumb question but I've got no idea
as to how Java application listen on sockets and
how they're supposed to act when something comes
on the socket.
Any explanation greatly appreciated : )