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. QUdpSocket::writeDatagram and connected UDP sockets

QUdpSocket::writeDatagram and connected UDP sockets

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 2.1k Views
  • 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.
  • C Offline
    C Offline
    Chromatix
    wrote on last edited by
    #1

    Hi there again,

    The documentation for "QUdpSocket::writeDatagram":http://qt-project.org/doc/qt-5.0/qtnetwork/qudpsocket.html#writeDatagram says:

    bq. Warning: Calling this function on a connected UDP socket may result in an error and no packet being sent. If you are using a connected socket, use write() to send datagrams.

    but provides no reason or explanation of why and when it results in error.

    Actually I am successfully using writeDatagram with both unconnected and "connected" QUdpSockets (via connectToHost()) on my Qt Windows application that is going to be compiled for other platforms too. And I can't see why this can fail.

    The source code of QNativeSocketEnginePrivate::nativeSendDatagram which does the actual datagram sending also looks very innocent, only able to generate DatagramTooLargeError and the generic NetworkError errors.

    I'm looking for more insight about this, probably from developers themselves. :)

    1 Reply Last reply
    0

    • Login

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