I am creating a simple QSocketServer in Qt. The socket starts to listen, but the incomingConnection method never seems to run. Can someone explain what is wrong here?
main:
m_pipeserver = new PipeServer(this);
if (m_pipeserver->listen("test.sock")) {
qDebug() << "STARTED";
}
pipeserver.h
class PipeServer : public QLocalServer
{
Q_OBJECT
public:
PipeServer(Controller *parent = 0);
protected:
void incomingConnection(qintptr socketDescriptor);
pipeserver.cpp
PipeServer::PipeServer(Controller *parent)
{
}
void PipeServer::incomingConnection(qintptr socketDescriptor)
{
qDebug() << "NEW CONNECTION";
// etc...
I see the STARTED message, but never see the NEW CONNECTION when I run:
socat -v READLINE unix-connect:/tmp/test.sock
Can anyone tell me why the incomingConnection is not firing?
-- UPDATE: Just for fun I hooked a method into the newConnection signal and that method DOES fire when I connect. So why isn't the incomingConnection method firing?