Results 1 to 7 of 7

Thread: Udp send and receive problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    519
    Thanks
    13
    Thanked 77 Times in 75 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Udp send and receive problem

    Hi, have you tried to temporarily disable the firewall completely?

    Ginsengelf

  2. #2
    Join Date
    Jan 2020
    Location
    Turkey
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Udp send and receive problem

    Quote Originally Posted by Ginsengelf View Post
    Hi, have you tried to temporarily disable the firewall completely?

    Ginsengelf
    Yes. I tried firewall. Still failing.

    I think I solved the problem. I flushed the pointer after writing or reading the datagram to the socket object I created. Then I noticed that the error was resolved. I wonder why?

    Qt Code:
    1. .
    2. ..
    3. ...
    4. socket = new QUdpSocket(this);
    5.  
    6. socket->writeDatagram(......);
    7. socket->flush(); < fix it
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Udp send and receive problem

    Without being able to see your code we can only guess. My guess is that your code does not return to the Qt event loop. To quote the docs, "In most cases, you do not need to call this function, because QAbstractSocket will start sending data automatically once control goes back to the event loop."

Similar Threads

  1. How to send and receive data with Eluetooth Low Energy?
    By tanthinh1510 in forum Qt Programming
    Replies: 0
    Last Post: 5th April 2016, 03:10
  2. QUdpSocket - Send and receive data
    By TheMasterNico in forum Qt Programming
    Replies: 13
    Last Post: 23rd April 2015, 22:24
  3. QUdpsocket send and receive broadcast in linux
    By danics in forum Qt Programming
    Replies: 5
    Last Post: 4th February 2015, 11:26
  4. Replies: 6
    Last Post: 5th February 2011, 20:18
  5. How to send and receive Email ??
    By wincry in forum Newbie
    Replies: 4
    Last Post: 18th October 2009, 17:51

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
  •  
Qt is a trademark of The Qt Company.