Results 1 to 2 of 2

Thread: QUdpSocket broadcast to multiple processes

  1. #1
    Join Date
    Sep 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QUdpSocket broadcast to multiple processes

    The broadcastsender and broadcastreceiver example don't seem to work for me.

    if i change the bind in the receiver from:

    Qt Code:
    1. udpSocket->bind(45454, QUdpSocket::ShareAddress);
    To copy to clipboard, switch view to plain text mode 
    to
    Qt Code:
    1. QHostAddress myAddress = QHostAddress("127.0.0.1");
    2. udpSocket->bindmyAddress, 45454, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint);
    To copy to clipboard, switch view to plain text mode 

    and the sender from

    Qt Code:
    1. udpSocket->writeDatagram(datagram.data(),datagram.size(), QHostAddress::Broadcast, 45454 );
    To copy to clipboard, switch view to plain text mode 
    to
    Qt Code:
    1. QHostAddress myAddress = QHostAddress("127.0.0.1");
    2. udpSocket->writeDatagram(datagram.data(),datagram.size(), myAddress, 45454 )
    To copy to clipboard, switch view to plain text mode 

    it starts to work.
    Before i ask my next question, could anyone shed some light on where i could look why this is the case ? From what i read the example should work as is ?

    thanks,
    tom

  2. #2
    Join Date
    Sep 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QUdpSocket broadcast to multiple processes

    found what was the problem.. the firewall was blocking all udp broadcasts.
    i figured it out when i temporarily switched off the firewall.

    thanks for thinking along all !

Similar Threads

  1. Qt/S60 QUdpSocket broadcast problem
    By harnen in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 13th April 2010, 22:13
  2. multiple QThreads with QUdpSocket and QTcpServer
    By radeberger in forum Qt Programming
    Replies: 0
    Last Post: 25th March 2010, 11:25
  3. Display from multiple processes in one GUI
    By abernat in forum Qt Programming
    Replies: 3
    Last Post: 17th September 2009, 20:08
  4. QUdpSocket - Multiple Network Interfaces
    By dbrmik in forum Qt Programming
    Replies: 0
    Last Post: 24th April 2009, 13:47
  5. QProcess Bash in Event Filter (Multiple Processes)
    By Arsenic in forum Qt Programming
    Replies: 1
    Last Post: 8th November 2008, 08:42

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.