java - External program blocks when run by Runtime exec -


I am trying to launch an example of the VideoLAN program from within the Java application, in the way I try to do this It has been shown here:

  process p = runtime.gettime (). Exec ("\" C: \\ Program Files \\ VideoLAN \\ VLC \\ vlc.exe \ "\" http: //www.dr.dk/Forms/Published/PlaylistGen.aspx? Qid = 1316859 and ODP = True \ ": sout = # std {access = udp, mux = ts, dst = 127.0.0.1: 63,928}");  

If I execute the above command, VLC program will be launched, and will start a streaming operation (it goes through connecting, buffering and then streaming steps).

When a runtime execution (or processbinder initiation) is executed by the command, the VLC program will hang by the end of the buffering phase. If all threads expire / expire in the Java program, then the VLC program will progress in the streaming phase. Until the VLC process closes, the Java process will not end, so this behavior is clearly the result of some kind of coupling between processes.

Command one. Tried to execute orders indirectly by typing in and executing the CMD file, but the result is in the same behavior.

My guess would be that VLC filled your STDOT buffer and hangs in the printf statement Given because STDOUT is waiting for that buffer to be empty.

You will have to get the stream and read it for the output of the process (even if you leave it).

I advise you to read this.

On the fourth page it is a good example of how to read the currents in thread so that the process of your child is not blocked. / P>


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -