void QServer::addToList(QLocalSocket* socket)
{
	//Store sockets & connect them for read & discard them on disconnect
	connection_list.push_back(socket);
	connect(socket, SIGNAL(readyRead()), this , SLOT(readSocket()));
	connect(socket, SIGNAL(disconnected()), this , SLOT(discardSocket()));
}
Exemplo n.º 2
0
Connection::Connection(QObject *parent) :
    QObject(parent)
{
    conection = new QLocalSocket(this);

    connect(conection,SIGNAL(readyRead()),this,SLOT(readSocket()));
    connect(conection,SIGNAL(disconnected()),this,SLOT(discardSocket()));
    conection->connectToServer(Packets::server_name_tag);
}