linphone-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-users] Linphone not responding when launched from Java


From: Adam Granger
Subject: Re: [Linphone-users] Linphone not responding when launched from Java
Date: Tue, 2 Sep 2014 14:16:49 -0100
User-agent: SquirrelMail/1.4.21

I've created a SSCCE for this. I've also noticed that if I don't use the
process.waitFor() the application does not lock up - any ideas why?

import java.io.File;
import java.io.IOException;
import java.io.InputStream;

public class LinphoneTest {

    public static void main(String[] args) throws IOException,
            InterruptedException {
        String phoneAppPath = "C:\\Program
Files\\Linphone\\bin\\linphone.exe";
        ProcessBuilder processBuilder = new ProcessBuilder(phoneAppPath);
        // move up from bin/linephone.exe
        File workingDir = new File(phoneAppPath).getParentFile()
                .getParentFile();
        processBuilder.directory(workingDir);
        Process process = processBuilder.start();
        processBuilder.redirectErrorStream();
        process.getErrorStream();
        InputStream stream = process.getInputStream();
        int i = 0;
        while (((i = stream.read()) != -1)) {
            System.out.println(i);
        }
        process.waitFor();

    }

}



> Greetings,
>
> I'm developing an application (written in Java) which amongst other things
> launches Linphone with a reconfigured linephonerc.
>
> I'm encountering a problem where after a few interactions the linphone
> application locks up with the classic windows hour glass/spinner and no
> longer responds to input, it un-freezes when I quit my application and
> then responds normally. This is fairly reproducible.
>
> My question is what could I be doing wrong?
>
> I'm launching it using ProcessBuilder in Java 8u11 on a separate Thread
> using something like this:
>
>    ProcessBuilder builder = new ProcessBuilder("c:\program
> files\linphone\bin\linphone.exe")
>    builder.directory("c:\program files\linphone");
>    builder.redirectErrorStream();
>    builder.start();
>
> I then have a loop when consumes any standard output with BufferedReader
> and saves to a log file, it never seems to output anything though. Also
> I've noticed the linphone.exe exits and spawns a new background process.
>
> I've seen this problem on both Windows XP and Windows 7 using LinPhone
> 3.7.0
>
> Regards,
>
> Adam.
>
>
> _______________________________________________
> Linphone-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/linphone-users
>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]