Warning: session_start(): open(/var/lib/php/sessions/sess_31d2gj0q5blllb77vjkanvcjlt, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
// TODO: clean up process!!
cmodule RunVectorSDK > DynPrintLogAndEnabled {
transient Process process;
transient PrintStream out;
start-thread {
if (!enabled) ret;
//File script = userDir("vector-sdk/cam-stream-to-stdout.py");
File script = userDir("vector-sdk/control-from-java.py");
assertFileExists(script);
makeExecutable(script);
print("Calling " + script);
process = Runtime.getRuntime().exec(platformQuoteOpt(script));
print("SDK process started");
print("PID: " + getOpt(process, "pid"));
//drainStreamInNewThread(process.getErrorStream());
out = new PrintStream(process.getOutputStream());
thread {
DataInputStream err = new(process.getErrorStream());
S line;
while ((line = in.readLine()) != null) {
if (enabled)
print("ERR: " + line);
}
}
DataInputStream in = new(process.getInputStream());
S line;
while ((line = in.readLine()) != null) {
if (enabled)
print("Got line: " + takeLast(100, line));
}
}
void cleanMeUp_process {
if (process != null) {
print("Stopping SDK process");
process.destroy/*Forcibly*/();
print("Stopped SDK process, hopefully");
}
}
// API
// returns true if (probably) successful
bool say(S s) {
if (out == null) false;
s = newLinesToSpaces_trim(s);
if (empty(s)) true;
print("Making Vector say: " + s);
out.println(s);
true;
}
}