Questions tagged [qlocalsocket]

QLocalSocket is a class in Qt framework to create local sockets mostly used for IPC.

QLocalSocket is a class in Qt framework to create local sockets mostly used for IPC. In Microsoft Windows implementation of Qt, this class is currently based on named pipes. See QLocalSocket for more information about this class.

35 questions
1
vote
1 answer

QLocalSocket - sharing a socket

I am creating an (linux) app and would like to use named socket. I believe that QLocalSocket implemts this. I'm missing something very basic - which is making it hard to understand the docs: Is QLocalSocket (local domain socket in Linux) full…
TSG
  • 4,242
  • 9
  • 61
  • 121
1
vote
1 answer

Qt 5.2: QLocalServer receiving duplicated readyRead signals

I'm puzzled with a problem designing a simple QLocalServer-QLocalSocket IPC system. The QLocalServer waits for a new connection and connect the signals to the proper slots. void CommandProcessor::onNewConnection() { QLocalSocket* pLocal =…
Hernán
  • 4,527
  • 2
  • 32
  • 47
1
vote
0 answers

QLocalSocket::disconnectFromServer() doesn't disconnect socket until event loop is reentered in Qt5 in Windows

I compiled a program for Qt5, and now it has different run-time behavior. In Qt5, the socket is not disconnected until the event loop is reentered, even though I explicitly wait for that with waitForDisconnected(). For example this…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
1
vote
0 answers

Persistent Qt Local Socket IPC

I'm developing an application that uses IPC between a local server and a client application. There is nothing particular to it, as it's structured like the Qt documentation and examples. The problem is that the client sends packets frequently and…
Hernán
  • 4,527
  • 2
  • 32
  • 47
1
vote
1 answer

QLocalSocket to QLocalServer message being corrupted during transfer

I haven't been able to find a similar issue, so here goes: I'm sending a QString from a QLocalSocket to a QLocalServer across two applications. The receiving (QLocalServer) application does receive the message, but it seems the encoding is…
dajaffe
  • 855
  • 13
  • 34
0
votes
1 answer

how to transfer QImage from QLocalServer to QLocalSocket

I have two mac apps that communicate with each other using QLocalSocket. Able to send the received QString but not able to send the received QImage Below is my code. SERVER SIDE CODE QImage image(":/asset/logo_active.png"); QByteArray ba; …
Mohammed Ebrahim
  • 849
  • 1
  • 12
  • 22
0
votes
1 answer

qLocalServer write blocked (full buffer), how to discard data?

I'm trying to understand how local sockets (Unix domain socket) works, specifically how to use them with QT. It is my understanding that Unix domain socket is always reliable and no data is lost. Looking at these examples these are the steps (making…
rok
  • 2,574
  • 3
  • 23
  • 44
0
votes
2 answers

C++ behaves differently in Qt, bind() returns EINVAL

I have already checked out bind() return EINVAL and that is not the issue here. Please read through before you get furious about duplication. I am trying to connect to wpa_supplicant. Basically I'm trying to achieve this using C++: import os import…
Gaurav
  • 145
  • 5
0
votes
0 answers

problem with QLocalSocket sending continues data to QLocalServer

I'm trying to send some data from QLocalSocket to QLocalSever in a loop. Sever only gets the first data and not receiving subsequent data, but if I introduce 1 mec delay between each call from the client then the server starts to receive everything.…
Vencat
  • 1,272
  • 11
  • 36
0
votes
1 answer

Close blocking QLocalServer from other thread

I am running a blocking QLocalServer in a thread: void QThread::stopServer() { m_abort = true; m_server.close(); // QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread } void QThread::run() { m_server =…
Hyndrix
  • 4,282
  • 7
  • 41
  • 82
0
votes
1 answer

Using async QLocalServer with QEventLoop

I want to run a QLocalServer in an application using asynchronous signals/slots which does not use QCoreApplication. As far as I understand this should work using a QEventLoop: void MyThread::startSocketServer() { m_server = new QLocalServer(); …
Hyndrix
  • 4,282
  • 7
  • 41
  • 82
0
votes
1 answer

QLocalSocket: Socket access error (error 3)

Recently finished compiling qt5 and qutebrowser on my FreeBSD system. Qutebrowser runs well when I run as root but otherwise gives me this socket access error. Have never done anything with or used qt5 before. I am assuming this is a permissions…
0
votes
1 answer

Passing a QLocalSocket* to a method expecting a QIODevice*

Perhaps I'm being over-ambitious, but I'm trying to write a server program which can accept connections over both QLocalSockets and QTcpSockets. The concept is to have a 'nexus' object with both a QLocalServer and QTcpServer listening for new…
Eos Pengwern
  • 1,467
  • 3
  • 20
  • 37
0
votes
0 answers

Undefined reference to QLocalSocket::QLocalSocket(QObject*)

I am trying to use QLocalSocket in QT, but I have the error Undefined Reference to QLocalSocket::QLocalSocket(QObject*) Here is the beginning of the .cpp : #include "client.h" Client::Client(QObject *parent) : QObject(parent), m_socket(new…
iAmoric
  • 1,787
  • 3
  • 31
  • 64
0
votes
1 answer

How should QLocalSocket/QDataStream be read to avoid deadlocks?

How should QLocalSocket/QDataStream be read? I have a program that communicates with another via named pipes using QLocalSocket and QDataStream. The recieveMessage() slot below is connected to the QLocalSocket's readyRead() signal. void…
sebf
  • 2,831
  • 5
  • 32
  • 50