Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QLocalSocket get filedescriptor
Forum Updated to NodeBB v4.3 + New Features

QLocalSocket get filedescriptor

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    archdove
    wrote on 30 Apr 2013, 07:43 last edited by
    #1

    Hi

    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.

    [code]
    QLocalSocket s;
    s.connectToServer("mplayer");

    s.waitForConnected();
    qDebug() << "connected" << endl;
    qDebug() << s.objectName() << endl;
    qDebug() << s.serverName() << endl;
    

    [/code]

    objectName and serverName are Empty..

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on 3 May 2013, 09:09 last edited by
      #2

      Hi,

      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()?

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        archdove
        wrote on 7 May 2013, 13:24 last edited by
        #3

        Thanks.

        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.

        1 Reply Last reply
        0

        1/3

        30 Apr 2013, 07:43

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved