コード例 #1
0
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()));
}
コード例 #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);
}