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?
in main:
m_pipeserver = new PipeServer(this);
if (m_pipeserver->listen("test.sock")) {
qDebug() << "STARTED";
}
m_pipeserver = new PipeServer(this);
if (m_pipeserver->listen("test.sock")) {
qDebug() << "STARTED";
}
To copy to clipboard, switch view to plain text mode
in pipeserver.h
class PipeServer : public QLocalServer
{
Q_OBJECT
public:
PipeServer(Controller *parent = 0);
protected:
void incomingConnection(qintptr socketDescriptor);
class PipeServer : public QLocalServer
{
Q_OBJECT
public:
PipeServer(Controller *parent = 0);
protected:
void incomingConnection(qintptr socketDescriptor);
To copy to clipboard, switch view to plain text mode
pipeserver.cpp
PipeServer::PipeServer(Controller *parent)
{
}
void PipeServer::incomingConnection(qintptr socketDescriptor)
{
qDebug() << "NEW CONNECTION";
// etc...
PipeServer::PipeServer(Controller *parent)
{
}
void PipeServer::incomingConnection(qintptr socketDescriptor)
{
qDebug() << "NEW CONNECTION";
// etc...
To copy to clipboard, switch view to plain text mode
I see the STARTED message, but never see the NEW CONNECTION when I run:
socat -v READLINE unix-connect:/tmp/test.sock
Just for fun I hooked a slot method onto the newConnection signal and that method DOES fire when I connect. So why isn't the incomingConnection method firing?
Bookmarks