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. Network - QUdpSocket::setSocketOption, doesn´t work

Network - QUdpSocket::setSocketOption, doesn´t work

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.8k Views 1 Watching
  • 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
    Croxman
    wrote on last edited by
    #1

    Hi,
    setSocketOption is useful function. I have used it for extension rcv and snd buffer in QUdpSocket, because i had problem with fast incoming packets and losing it, here is the code:
    udpSocket->setSocketOption(QAbstractSocket::SendBufferSizeSocketOption, SNDBUF_SIZE_UDP); udpSocket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, RCVBUF_SIZE_UDP);

    It works fine, when app are running on the same PC with local addresses 127.0.0.1. If I trying it on two PC throw local network, that functions doesn´t work. Default buffer for QUdpSocket has 8 kB and it is very few. I am using Qt ver 5.3.
    Thanks for your advice,
    Petr

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Croxman
      wrote on last edited by
      #2

      I have tried, if the parameters were correct set. In case ReceiveBufferSizeSocketOption was and SendBufferSizeSocketOption wasn´t. This is reason, why it was fine on same PC and with incoming mistakes with two PC. Have you got any idea, what could be wrong on udpSocket->setSocketOption(QAbstractSocket::SendBufferSizeSocketOption, SNDBUF_SIZE_UDP)? Thank you,
      Petr

      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