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
16
votes
1 answer

Is QLocalSocket really used for namedpipes

According to th Qt documentation if we want to use named pipes on windows, we can use QLocalSocket. I am writing a server and client program with Qt. If I try to use the WIN32 API to write some message in the pipe line, the Qt client does not show…
paytam
  • 327
  • 6
  • 15
10
votes
2 answers

not able to start qlocalserver

I use Qlocalsocket in my IPC solution and I am able to start the server and accept connections from QLocalSocket clients and communicate well, no prob in that. but my problem happens when I kill the process of the server , I can't make QLocalServer…
Dorgham
  • 962
  • 1
  • 9
  • 17
3
votes
0 answers

Should I receive all messages after QLocalSocket is disconnected?

I have an application in c++/Qt in Windows, Linux and MacOSX, and I have a local client-server mechanism using Qt Local Server/Socket. When the server refuses a connection, I send a message and close the socket, using…
n3mo
  • 663
  • 8
  • 23
3
votes
2 answers

Qt4.5: Using event-loop based localsocket before app.exec

I'm facing a practical problem with Qt. I'm using a class that communicates with QLocalSocket to another process (pipes/unix sockets) and I need to do that communication before other events occur, that is before app.exec() starts (or more…
Hernán
  • 4,527
  • 2
  • 32
  • 47
3
votes
3 answers

QLocalSocket::connectToServer failed with QLocalSocket::SocketAccessError if server is running with administrative privileges (Windows 7)

Following problem occurs in Microsoft Windows 7 Implementation of Qt 4.8.1: A QLocalServer (named pipe) is waiting for clients to connect, and it is running as an server application that runs with administrative privileges (system service for…
bkausbk
  • 2,740
  • 1
  • 36
  • 52
2
votes
1 answer

Problem with sending data to QLocalServer as a client before closing

I'm learning Qt and having some troubles with sending some data to QLocalServer before closing the client application. In the example i've tried to send "bye" twice. But on server side i've recieved it only once. No matter how many times client will…
pewpawpew
  • 31
  • 3
2
votes
0 answers

Creating a local socket in a custom location with Qt

I'm using QLocalServer to create a local socket so that other processes can connect to my Qt application. My problem is that Qt seems hellbent on creating the socket file in /tmp/, but I would prefer to follow XDG guidelines and use the…
2
votes
0 answers

QSharedMemory and QLocalSocket: performance questions

I'm looking for IPC with high performance in Qt (v5.3) on Windows. In my final situation, I will have 3 (or more) producer process and one consumer process. Before that, I made some tests using 1 producer thread and 1 consumer thread, using both…
arthur86
  • 531
  • 1
  • 3
  • 20
2
votes
0 answers

QLocalServer IPC client works, server not

okay this one seems tricky. I implemented a QLocalServer to do some IPC. But it won't work properly. The client connects and tells me he is connected. the server...well...not, which makes me unable to recieve any messages. the server implementation…
Mr.Manhattan
  • 5,315
  • 3
  • 22
  • 34
1
vote
2 answers

How to emit error for QLocalSocket

I am implementing 'Local fortune server' example (from Qt 4.7.3) as a service on Windows. What i want is that when someone paused the service, the local server should notify the error to the connected local socket (local fortune client). The error…
cyber_raj
  • 1,780
  • 1
  • 14
  • 25
1
vote
2 answers

Trouble binding to a socket from a PHP script

I'm very new to PHP so this might be something simple. Anyway, I'm trying to create 2-way communication between a PHP script (activated by a web client) and a local process (written in C++). The PHP script should send some information to the C++…
Matt Phillips
  • 9,465
  • 8
  • 44
  • 75
1
vote
0 answers

Why QLocalSocket is designed to be connected only to local pipes in "Windows"?

So in QT5.7.0 sources qlocalsocket_win.cpp there are lines: const QLatin1String pipePath("\\\\.\\pipe\\"); if (d->serverName.startsWith(pipePath)) d->fullServerName = d->serverName; else d->fullServerName = pipePath + d->serverName; So…
Igor Zhidkov
  • 41
  • 1
  • 4
1
vote
1 answer

QLocalSocket - QTimer and Lambda

I have a strange behavior with Lambda and timer on Qt 5.7.1. Probably a mistake from me. I start a connection with a socket and set a timer to check whether it was connected or not after a certain amount of time. The signal connected of the socket…
Damien
  • 1,492
  • 10
  • 32
1
vote
0 answers

Is it possible to get a PID out of a QLocalSocket connection?

I'm building a client/server architecture where a client process can connect to a server using local Unix domain sockets. The server process is implemented in Qt and uses QLocalServer and QLocalSocket to maintain the connection at the server end. Is…
1
vote
0 answers

QLocalServer with multiple clients -- proper handling

I'm trying to make IPC work between one server to accept requests from multiple clients with Qt 4.6. All is working, except that the underlying named pipes are not being closed, making Qt to emit the maximum handle reached message (62). Since I want…
Hernán
  • 4,527
  • 2
  • 32
  • 47
1
2 3