TCP/IP localhost communcation issue
up vote
0
down vote
favorite
I am using Qt and QTcpSocket class to develop two console applications communicating each other via socket in localhost on the same machine. This has to be done via socket for backward compatibility.
During the execution, a third application requires a lot of CPU, which usage goes quickly to 100% for some seconds. I can't avoid this behavior. In this situation, the communication gets a delay (i.e. the string sent from the application A is received by the application B many hundreds of ms later).
Obviously, the socket runs in a specific thread and I set the thread's priority to TimeCritical:
QThread::currentThread()->setPriority(QThread::TimeCriticalPriority);
Do you know how to solve this problem?
Thanks
qt cpu-usage tcp-ip qtcpsocket thread-priority
add a comment |
up vote
0
down vote
favorite
I am using Qt and QTcpSocket class to develop two console applications communicating each other via socket in localhost on the same machine. This has to be done via socket for backward compatibility.
During the execution, a third application requires a lot of CPU, which usage goes quickly to 100% for some seconds. I can't avoid this behavior. In this situation, the communication gets a delay (i.e. the string sent from the application A is received by the application B many hundreds of ms later).
Obviously, the socket runs in a specific thread and I set the thread's priority to TimeCritical:
QThread::currentThread()->setPriority(QThread::TimeCriticalPriority);
Do you know how to solve this problem?
Thanks
qt cpu-usage tcp-ip qtcpsocket thread-priority
can you provide a Minimal, Complete, and Verifiable example
– Redanium
6 hours ago
which OS do you use? setPriority() is not supported on linux doc.qt.io/archives/qt-4.8/qthread.html#setPriority
– transistor
4 hours ago
On Linux you may run your program with ‚nice‘, on windows you can set the execution execution rights, if you have an admin account: support.microsoft.com/en-gb/help/110853/…
– transistor
3 hours ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am using Qt and QTcpSocket class to develop two console applications communicating each other via socket in localhost on the same machine. This has to be done via socket for backward compatibility.
During the execution, a third application requires a lot of CPU, which usage goes quickly to 100% for some seconds. I can't avoid this behavior. In this situation, the communication gets a delay (i.e. the string sent from the application A is received by the application B many hundreds of ms later).
Obviously, the socket runs in a specific thread and I set the thread's priority to TimeCritical:
QThread::currentThread()->setPriority(QThread::TimeCriticalPriority);
Do you know how to solve this problem?
Thanks
qt cpu-usage tcp-ip qtcpsocket thread-priority
I am using Qt and QTcpSocket class to develop two console applications communicating each other via socket in localhost on the same machine. This has to be done via socket for backward compatibility.
During the execution, a third application requires a lot of CPU, which usage goes quickly to 100% for some seconds. I can't avoid this behavior. In this situation, the communication gets a delay (i.e. the string sent from the application A is received by the application B many hundreds of ms later).
Obviously, the socket runs in a specific thread and I set the thread's priority to TimeCritical:
QThread::currentThread()->setPriority(QThread::TimeCriticalPriority);
Do you know how to solve this problem?
Thanks
qt cpu-usage tcp-ip qtcpsocket thread-priority
qt cpu-usage tcp-ip qtcpsocket thread-priority
asked 9 hours ago
Andrea Quattrini
11
11
can you provide a Minimal, Complete, and Verifiable example
– Redanium
6 hours ago
which OS do you use? setPriority() is not supported on linux doc.qt.io/archives/qt-4.8/qthread.html#setPriority
– transistor
4 hours ago
On Linux you may run your program with ‚nice‘, on windows you can set the execution execution rights, if you have an admin account: support.microsoft.com/en-gb/help/110853/…
– transistor
3 hours ago
add a comment |
can you provide a Minimal, Complete, and Verifiable example
– Redanium
6 hours ago
which OS do you use? setPriority() is not supported on linux doc.qt.io/archives/qt-4.8/qthread.html#setPriority
– transistor
4 hours ago
On Linux you may run your program with ‚nice‘, on windows you can set the execution execution rights, if you have an admin account: support.microsoft.com/en-gb/help/110853/…
– transistor
3 hours ago
can you provide a Minimal, Complete, and Verifiable example
– Redanium
6 hours ago
can you provide a Minimal, Complete, and Verifiable example
– Redanium
6 hours ago
which OS do you use? setPriority() is not supported on linux doc.qt.io/archives/qt-4.8/qthread.html#setPriority
– transistor
4 hours ago
which OS do you use? setPriority() is not supported on linux doc.qt.io/archives/qt-4.8/qthread.html#setPriority
– transistor
4 hours ago
On Linux you may run your program with ‚nice‘, on windows you can set the execution execution rights, if you have an admin account: support.microsoft.com/en-gb/help/110853/…
– transistor
3 hours ago
On Linux you may run your program with ‚nice‘, on windows you can set the execution execution rights, if you have an admin account: support.microsoft.com/en-gb/help/110853/…
– transistor
3 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53266014%2ftcp-ip-localhost-communcation-issue%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
can you provide a Minimal, Complete, and Verifiable example
– Redanium
6 hours ago
which OS do you use? setPriority() is not supported on linux doc.qt.io/archives/qt-4.8/qthread.html#setPriority
– transistor
4 hours ago
On Linux you may run your program with ‚nice‘, on windows you can set the execution execution rights, if you have an admin account: support.microsoft.com/en-gb/help/110853/…
– transistor
3 hours ago