Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qudpsocket
    Log in to post
    • All categories
    • R

      Solved QUdpSocket: Picking a specific network interface
      General and Desktop • qudpsocket qnetwork multicast • • rtavakko

      15
      0
      Votes
      15
      Posts
      1333
      Views

      R

      The solution that worked for me was to pick the network adapter and then look through its list of IP addresses to pick one to bind the socket to based on given criteria as suggested by @kshegunov. I've updated the example project:
      https://github.com/rtavakko/MulticastServer

    • L

      Unsolved Signal inside readyread of QUdpsocket
      General and Desktop • signal & slot threading udp qudpsocket • • Lior

      7
      0
      Votes
      7
      Posts
      410
      Views

      Christian Ehrlicher

      @Lior said in Signal inside readyread of QUdpsocket:

      why the UI main thread stoped to respond ? the msleep is in anthor thread.

      Because you do it wrong (and I would guess the msleep is not in the thread but in the gui thread) but without code...

    • goldenhawking

      Solved QUdpSocket Benchmark for Package Lost Ratio
      General and Desktop • qudpsocket package lost • • goldenhawking

      5
      0
      Votes
      5
      Posts
      265
      Views

      Christian Ehrlicher

      There is no buffering of a udp datagram in Qt code - the only thing you can do is to increase the os udp buffer. But I don't see this as drawback of Qt - it's simply the nature of UDP.

    • C

      Solved QUdpSocket disconnects after data writing
      General and Desktop • network qudpsocket • • ClingerWinger

      4
      0
      Votes
      4
      Posts
      703
      Views

      aha_1980

      @ClingerWinger Glad you figured it out and thanks for the feedback :)

    • G

      Unsolved Best way to retrieve data from different servers using UDPSocket
      General and Desktop • qudpsocket many servers • • Gacha

      4
      0
      Votes
      4
      Posts
      844
      Views

      K

      @Gacha

      I am not sure where you see the problems.

      The connections between signal and slots are removed with destruction of either object

      There is an issue when you are deleting an object when you are deleting it from the slot routine which is called an object's signal. I can imagine that there you may face a problem when using unique_ptr. To avoid this there is deleteLater()

    • Jesse Kaukonen

      Unsolved Issues using QUdpSocket::writeDatagram for high volumes of data
      General and Desktop • qudpsocket udp writedatagram packet loss • • Jesse Kaukonen

      3
      0
      Votes
      3
      Posts
      4213
      Views

      Jesse Kaukonen

      @kshegunov said:

      I advise benchmarking the code. For one a datagram will always arrive whole (not like with TCP where you can have the message chopped in pieces), but there's a maximum size to it. Also there's no reception notification (like with TCP) as UDP is a "connectionless" protocol. These two things in mind you either send the datagram or not, you can't have anything else returned for the written bytes.

      I suspected as much. Good to know.

      QByteArray datagram; // ... Insert size checks here as well! PendingCompressedFrame & frame = *reinterpret_cast<PendingCompressedFrame *>(datagram.data()); // No copying, valid while the byte array is still there.

      As of yet, the receiver's processing time hasn't been a bottleneck so I haven't looked into optimizing it (it completes in around 0-1ms). Thank you for the suggestion though.

      Additionally, why the mutex? What are you protecting with it exactly?

      The mutex is not needed there. There's some other data that is being accessed from a DLL from a separate thread, but I should have removed the mutex from the simplified receiver.

      One good way to deal with such throughput is to have a dedicated thread for the reception that'll put the received datagrams (no processing) into a thread safe queue (or you can also use a signal-slot connection). From there you can have another thread that orders them (they may not come in the order of sending) and ultimately preparing them for display.

      That's a good idea. Keep readyRead() as minimal as possible to get data out of the socket's buffer, allowing more data in.

      The biggest question I'm still wondering is the performance of writedatagram. I've been looking into the assorted socket options, but it will take some reading to really understand what's going on with each flag.

    • A

      Unsolved Unexpected Memory Leak in Windows 10?
      General and Desktop • memory leak qudpsocket windows 10 • • AnnaB

      7
      0
      Votes
      7
      Posts
      3053
      Views

      kshegunov

      @AnnaB
      There's one thing bothering me though ... You said you can't afford to drop a frame, but you use datagrams, which are inherently unsafe (in that manner) ... otherwise I'd assume it's what @SGaist said - probably your processing is lagging behind and there's work queuing up ...

    • B

      Unsolved QUdpSocket::hasPendingDatagrams() broken in Qt 5.5 on Windows Desktop
      General and Desktop • qtnetwork qudpsocket windows desktop qt5.5 • • bsomervi

      3
      0
      Votes
      3
      Posts
      2903
      Views

      B

      Raised issue https://bugreports.qt.io/browse/QTBUG-49301

    • K

      Binding more than one time to the same UDP port
      General and Desktop • qudpsocket bind binding • • koahnig

      2
      0
      Votes
      2
      Posts
      1083
      Views

      K

      OK, found that there are two sides for that coin as well.
      I need to check the other side as well as one sees in the mutlicast sender example.

    • K

      Stepping into QUdpSocket WriteDatagram with Qt Creator
      Tools • qtcreator debugging qudpsocket • • kzawada

      1
      0
      Votes
      1
      Posts
      544
      Views

      No one has replied

    • K

      Multicast with QUdpSocket and QHostAddress::Any does not work
      General and Desktop • qudpsocket multicast • • kzawada

      8
      0
      Votes
      8
      Posts
      3569
      Views

      SGaist

      Did you check with the latest Qt 5.5 if you still experience this behavior ?

    • K

      QAbtractSocket bind flags
      General and Desktop • qudpsocket bind shareaddress udp • • koahnig

      1
      0
      Votes
      1
      Posts
      782
      Views

      No one has replied

    • K

      [SOLVED] Trying to get Ntp client to work
      General and Desktop • ntp qudpsocket • • koahnig

      17
      0
      Votes
      17
      Posts
      8317
      Views

      K

      @SGaist

      Thanks for following up. Certainly I will take care this next time. I guess I will remember.