We have batch files that my company likes to run overnight so I took our server(MatLab)/client(Java/Eclispe) code, that worked fine with single files, put a while true loop around everything and got it to work properly that way. The only problem we have it that the server always looks for a client, with the socket.accept() call, but if it has no clients to connect to it, it just sits there forever. To close the program we have to go to the task manager and force it closed.
So it there any way I could put a timer on accept so if no one tries to connect after a certain time, no more batch files to run, I can cancel the connect and shutdown the program.