QWSSocket::connectToLocalFile could not connect:: Connection refused
-
Hello,
In my embedded target, when I run the application without QWS Server, I get the following error
@
root@am335x-evm:~# ./lab1
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
No Qt for Embedded Linux server appears to be running.
If you want to run this program as a server,
add the "-qws" command-line option.
@The documentation here is very clear that I need to add "-qws".
Example:
@
./lab1 -qws
@I understand the necessity of QWS option.
My question is, when I run the the application without QWS parameter, I get these errors in "Run-time"
@
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
QWSSocket::connectToLocalFile could not connect:: Connection refused
@Instead of Qt throwing these errors, I would like to catch them in my application and process them.
Is there any way to catch these errors in the application?
Thanks,
Kumara -
Hi,
You need to have one QWS server running to server your (or more) application. So the question is: why don't you want one ?
-
Hi Sam,
I understand that one QWS server should be in running state.
And, I would like to have one running always.
My question is around,
For some reason, if QWS stops running, then my application would stop abruptly.Instead of that, I want to handle that exception in my application. If QWS stops working, then I might want to log an error message in my application logs.
Hope am clear. Please let me know if you have more questions.
Thank you,
Kumara -
Are you planning on running multiple QWS application on your target ?
-
Sam,
No. Am not planning to run multiple QWS server in my embedded target.
My goal is, In my application, identify if QWS server is running or not. If it doesn't run, start QWS from application or show popup message to the user or convey the error message in console.
-
If you don't run multiple application then you don't need to do that detection since you application will also be the server.
-
OK. That makes sense Sam.
The reason behind this question is, In my system, there is going to be a main application which spawns all the other processes. In that, one of the process is GUI application.
It means that, GUI is just optional, other processes will make the product to continue to work.
Getting back to GUI application being QWS server, The parent process who spawns the GUI process, needs to know the status of QWS server. For some reason, if QWS server stops running, that would result in GUI not being displayed on LCD. So, if parent process knows the status, then it can manage to restart the GUI process again.
In short, it's sort of mistake proofing (Failure mode detection)
Please let me know if I was not clear.
Thanks,
Kumara -
So basically you have two GUI applications, correct ? In that case why not have a third that will be the manager application whom will handle the qws server but nothing else. You other two applications would just be connecting to the server.
-
@SGaist This is exactly what I need. How do I create a manager that would handle qws server and nothing else? Can you give me hint with example?
That will be really useful for me.Thank you,
Kumara -
For starter, I'd just create a dummy application instantiating a QApplication and calling exec on it. I haven't tried though but I think it should be enough