Problem:
if you try to start local socket server on unix using QLocalServer for IPC and the server crashed without closing , then when you try to start it again, listen will fail unless you change the serverName you are listening on...
here is a sample code:
proposed solution:
when the local socket server starts, it creates a file in /tmp with the name of the server, so next attempt to listen will find this address in use, you should remove the file /tmp/serverName to be able to start again.
sample code:
if you try to start local socket server on unix using QLocalServer for IPC and the server crashed without closing , then when you try to start it again, listen will fail unless you change the serverName you are listening on...
here is a sample code:
m_server = new QLocalServer(this);
if (!m_server->listen("serverUniqueName")) {
qDebug() << "Not able to start the Server";
return;
}
proposed solution:
when the local socket server starts, it creates a file in /tmp with the name of the server, so next attempt to listen will find this address in use, you should remove the file /tmp/serverName to be able to start again.
sample code:
m_server = new QLocalServer(this); if (!m_server->listen("serverUniqueName")) {if(!QFile::remove("/tmp/) || !m_server->listen(serverUniqueName"")){ qDebug() << "Not able to start the Server";serverUniqueName"return; } }
Thanks for post, it's worked and my issue resolved using your solution.
ReplyDeleteThis institute matches what learners expect from a top software training brand.
ReplyDeletecloud computing Training in Hyderabad with placements
Great explanation with relevant insights that enhance understanding.
ReplyDeletepython coaching center near me
python training in hyderabad
python training in hyderabad with placement
python training institute in hyderabad
python coaching classes near me
best institute for python in hyderabad Join with us for Python training.