QLocalSocket get filedescriptor
I am trying to communicate with mplayer on linux. Mplayer can accept an input file which can be a pipe. It is not stated that it can't be anything else so i want to try the use with QLocalSocket because i want to run the software on windows too eventually.
How do i get the Filedescriptor to the socket created in this code? Something is located in /tmp/qt../sub_socket but since this path is not fix at all i need to get the path at runtime.
s.waitForConnected(); qDebug() << "connected" << endl; qDebug() << s.objectName() << endl; qDebug() << s.serverName() << endl;
objectName and serverName are Empty..
to access to file descriptor you should use QLocalSocket::socketDescriptor().
To set Object Name you use setObjectName ().
serverName () is empty if connection fails; you checked the return value of waitForConnected()?
I found out that using LocalSocket together with LocalServer is the way to go for normal IPC. Its just too bad that there is no chance to use the systemc messaging capabilities with the same code running on different platforms.
This topic is closed.
Solution is to use fifos to interact with mplayer.