I'm creating an application where I use the jShell library:
B4X:
Dim shl As Shell
shl.Initialize("shl", "java.exe" , Array As String("-jar", "admin.jar", 0))
shl.WorkingDirectory = "C:\matrix2\module_admin\Objects"
shl.Run(-1) 'set a timeout of 10 seconds
When I close the application to StdOut I get the information. I do not know where it comes from.
B4X:
Port=3662
So it looks like the data returned. The opened application uses UDP, this information is basically the port on which it is listening ..
What should I return an open application to this StdOut? Where or how to define the information returned by the app at closing.
I have two applications, I open second application over the first one with jShell. When I close the second application, I get to the StdOut data in the form "Port = 3662".
They communicate with each other via UDP and the returned information is the UDP port of second application.
Where is the normally defined information returned by StdOut? I can not figure out what in second application causes StdOut to show this UDP port.
You can run it with RunWithOutputEvents and then handle the StdOut and StdErr events. Note that they are raised on background threads. You can use CallSubDelayed to call a sub on the main thread.