Results 1 to 2 of 2

Thread: qudpsocket and localhost

  1. #1
    Join Date
    Apr 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default qudpsocket and localhost

    I have been using udpSocket.bind(12345) to listen for incoming packets from another piece of software, works great. But only if the software is sending to localhost. I would like to bind to the IP address (192.168.1.100) as I need to communicate between machines, but the code below returns success, but never sees a packet, what am I missing? It is on windows.

    thanks,

    Qt Code:
    1. QHostAddress addr(QHostAddress::QHostAddress("192.168.1.100"));
    2. if(udpSocket.bind(addr,12345))
    3. qDebug("success");
    4. else
    5. qDebug("fail");
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qudpsocket and localhost

    can you post the code where you send and receive datagrams?
    A camel can go 14 days without drink,
    I can't!!!

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.