F
fishfry
I need to write a batch program that listens for commands on a socket
.... in other words the main loop is
check socket for special command
handle request if present
else do next iteration of normal batch processing.
On a Unix system in C or Perl I'd use select() with a non-blocking
socket.
Can I do the equivalent in Java?
Or if not, would I listen for socket requests in a separate thread? That
seems like a Java-ish way to do it.
.... in other words the main loop is
check socket for special command
handle request if present
else do next iteration of normal batch processing.
On a Unix system in C or Perl I'd use select() with a non-blocking
socket.
Can I do the equivalent in Java?
Or if not, would I listen for socket requests in a separate thread? That
seems like a Java-ish way to do it.