After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 731566 - tcpserversrc: close the server socket after accepting a connection
tcpserversrc: close the server socket after accepting a connection
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 1.3.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-06-12 11:30 UTC by Michael Olbrich
Modified: 2014-06-13 10:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.07 KB, patch)
2014-06-12 11:30 UTC, Michael Olbrich
committed Details | Review

Description Michael Olbrich 2014-06-12 11:30:42 UTC
Created attachment 278329 [details] [review]
patch

g_socket_accept() is only called once for a server socket. So keeping the
socket open ist just confusing possible clients.
Comment 1 Tim-Philipp Müller 2014-06-13 09:16:39 UTC
Hrm, it's not clear to me that multiple client connections shouldn't be possible.
Comment 2 Michael Olbrich 2014-06-13 09:44:10 UTC
tcpserversrc has one server_socket and one client_socket.
- in gst_tcp_server_src_start the server_socket is initialized
- in gst_tcp_server_src_create the client_socket is created if it does not exist yet.
- in gst_tcp_server_src_stop both client and server socket are closed.

So for each server_socket accept is only ever called once. So keeping the socket open just confuses clients.
Comment 3 Tim-Philipp Müller 2014-06-13 10:21:09 UTC
I wasn't questioning the logic of what you said, but whether the element should work as it currently works :)

However, turns out I was just confused. It's a server *source* not a sink, so multiple clients doesn't really make sense.

Thanks for the patch, pushed:

 commit 5ebfe5b26b6e404e663945fbd61ad7ca3f1a058b
 Author: Michael Olbrich <m.olbrich@pengutronix.de>
 Date:   Thu Jun 12 12:36:26 2014 +0200

    tcpserversrc: close the server socket after accepting a connection
    
    g_socket_accept() is only called once for a server socket. So
    keeping the socket open ist just confusing possible clients.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=731566