use of org.python.pydev.shared_core.io.HttpProtocolUtils in project Pydev by fabioz.
the class DebuggerReader method run.
/**
* keep reading until we finish (that should happen when an exception is thrown, or if it is set as
* done from outside)
*
* @see java.lang.Runnable#run()
*/
@Override
public void run() {
HttpProtocolUtils httpProtocol = new HttpProtocolUtils();
ICallback<String, Object> onUnexpectedMessage = (unexpectedMessage) -> {
String msg = "It seems an old version of the PyDev Debugger is being used (please update the pydevd package being used).\n\nFound message:\n" + unexpectedMessage;
RunInUiThread.async(() -> {
PyDialogHelpers.openCritical("Error", msg);
});
Log.log(msg);
return null;
};
while (!done) {
String contents;
try {
if ((contents = httpProtocol.readContents(in, onUnexpectedMessage)) == null) {
done = true;
} else {
if (contents.length() > 0) {
processCommand(contents.toString());
}
}
} catch (Exception e1) {
done = true;
// that's ok, it means that the client finished
if (DEBUG) {
e1.printStackTrace();
}
}
if (done || socket == null || !socket.isConnected()) {
AbstractDebugTarget target = remote;
if (target != null) {
target.terminate();
}
done = true;
}
}
}
Aggregations