QLocalSocket connection error
Hi,
I am using qlocalsocket to establish connection with another program on the same machine. The server has been wrote in c and it works fine.
The client has been wrote in qt. (using qlocalsocket.)
This is my simple example:
LocalSocket socket;
socket.connectToServer(“mySocketâ€);
socket.open(QIODevice::ReadWrite);
But I got erro like this: No such file or directory.
I checked whether mySocket is created by server or not. It did.
What could be the problem?
Thanks, David
Re: QLocalSocket connection error
Are you using a relative or absolute path to the socket?
Re: QLocalSocket connection error
The two programs are in the same place. So I use relative path.
By the way I tested the following:
I wrote this:
QLocalSocket *mySocket = new QLocalSocket();
I got error: Resource temporarily unavailable
Re: QLocalSocket connection error
Quote:
Originally Posted by
David_
The two programs are in the same place. So I use relative path.
So use an absolute one. It doesn't matter if they are in the same place or not. What matters is their current working directory.
Re: QLocalSocket connection error
I searched a lot and I found that the problem may with the socket. I mean there may are too many socket in open mod.