[Bug 785684] rtspconnection: add API to send messages without blocking

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Oct 25 08:44:43 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=785684

--- Comment #21 from Branko Subasic <branko.subasic at axis.com> ---
(In reply to Tim-Philipp Müller from comment #20)
> Sorry, I was thinking of send_messages() earlier (plural). My contention was
> that the entire while() loop, so most of the function, can be replaced with
> _send_messages() on a blocking socket instead.
> 
> I am not sure if the code you quote makes sense. I think a single message
> will always be fully written or not. It doesn't make sense to send a partial
> message/packet (and there's an error code for when it's too big). And makes
> even less sense to re-send parts of a message/packet, and there's no
> mechanism to say that this is the continuation from the previous one.
> 
> So I don't think we need to worry about this.

Well, g_socket_send_messages() uses sendmmsg(), which behaves that way for
datagram sockets. So for UDP it behaves that way. For stream sockets it does
not behave that way. In fact up until recently you could even get data from the
different messages mixed. This "recent" patch in the kernel remedies that
particular flaw: https://patchwork.kernel.org/patch/9616969. 
But even after that patch partial writes may occur.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list