<div dir="ltr">Dear All:<div><br></div><div style>Greeting, people.</div><div style><br></div><div style>I'm writing a app (<a href="https://github.com/duzy/gst-switch">https://github.com/duzy/gst-switch</a>), which will recreate some pipelines with <b>tcpserversink</b> elements lots of times. I'm now confronting an issue, which is:</div>
<div style><br></div><div style>GLib-ERROR **: Creating pipes for GWakeup: Too many open files<br></div><div style><br></div><div style>By hacking into <i>gsttcpserversink.c</i> and <i>gstmultisocketsink.c</i> in <b>gst-plugins-base</b>, I found that <b>tcpserversink</b> is not closing any client sockets it served. Instead, it will issue a "client-socket-removed" signal, which allows application code to <b>close</b> the FD.</div>
<div style><br></div><div style>So I should need to close the socket FD by myself to avoid too-many-open-files problem.</div><div style><br></div><div style>But I've tried to do these:</div><div style><br></div><div style>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><font color="#444444">g_signal_connect (sink, "<b>client-socket-removed</b>",</font></div><div style><font color="#444444"> G_CALLBACK (<b>gst_composite_output_client_socket_removed</b>), composite);</font></div>
<div style><br></div></div></blockquote><div style><div style>And in the function <span style="color:rgb(68,68,68)"><b>gst_composite_output_client_socket_removed</b></span>, I performs the closing of the socket file descriptor. Which I think should be the solution for the too-many-open-files problem.</div>
<div style><br></div><div style>But I tried many times, it looks like "<b>client-socket-removed</b>" was not emitted at all. So the callback function was not called.</div><div style><br></div><div style>I've gone through gstmultisocketsink.c many times, it looks that signal is not emitted while the state of the element changed from ready into null (say <b>GST_STATE_CHANGE_READY_TO_NULL</b>).</div>
<div style><br></div><div style>Does someone got any ideas on the <b>client-socket-removed</b> signal of <b>tcpserversink</b>? Is it a "unimplemented" feature or something else of tcpserversink? I will be very much thankful for any tips of it.</div>
</div></div><div style><br></div><div style>Best Regards Sincerely</div><div style>Duzy Chan</div><div style><br></div><div style><br></div></div>