GNOME Bugzilla – Bug 731566
tcpserversrc: close the server socket after accepting a connection
Last modified: 2014-06-13 10:21:17 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.
Hrm, it's not clear to me that multiple client connections shouldn't be possible.
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.
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