Results 1 to 5 of 5

Thread: QLocalSocket connection error

  1. #1
    Join Date
    Apr 2012
    Location
    Hungary, Budapest
    Posts
    9
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default 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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QLocalSocket connection error

    Are you using a relative or absolute path to the socket?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Apr 2012
    Location
    Hungary, Budapest
    Posts
    9
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default 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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QLocalSocket connection error

    Quote Originally Posted by David_ View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    David_ (4th December 2012)

  6. #5
    Join Date
    Apr 2012
    Location
    Hungary, Budapest
    Posts
    9
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default 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.
    Last edited by David_; 4th December 2012 at 15:31.

Similar Threads

  1. error while execution duplicate connection name
    By khadija123 in forum Qt Programming
    Replies: 1
    Last Post: 13th April 2012, 15:59
  2. Replies: 0
    Last Post: 2nd September 2011, 12:52
  3. emit error for QLocalSocket
    By raj_iv in forum Qt Programming
    Replies: 2
    Last Post: 31st August 2011, 12:14
  4. Error signal connection between 2 classes
    By mattia in forum Newbie
    Replies: 6
    Last Post: 31st October 2007, 10:36
  5. Replies: 3
    Last Post: 22nd June 2006, 17:27

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.