[Bug 720393] Unable to Cancel or Abort tcpclientsink Timeout

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Dec 16 09:27:02 PST 2013


https://bugzilla.gnome.org/show_bug.cgi?id=720393
  GStreamer | gst-plugins-base | 0.10.36

--- Comment #4 from Daren Thomas <daren.thomas at updatelogic.com> 2013-12-16 17:26:53 UTC ---
Unfortunately it's not easy for me to try with 1.x.  I would have to integrate
that into my application and I'm not sure how much effort that would take. 
After looking at the source code for 1.2.1, I suspect it would work though.

I fixed the problem for my application by setting the send timeout in the
gst_tcp_client_sink_start() function of gsttcpclientsink.c:

----------------------------------------
/* create a socket for sending to remote machine */
static gboolean
gst_tcp_client_sink_start (GstTCPClientSink * this)
{
  int ret;
  gchar *ip;
  struct timeval timeout;
  timeout.tv_sec = 60;
  timeout.tv_usec = 0;

  if (GST_OBJECT_FLAG_IS_SET (this, GST_TCP_CLIENT_SINK_OPEN))
    return TRUE;

  /* reset caps_sent flag */
  this->caps_sent = FALSE;

  /* create sending client socket */
  GST_DEBUG_OBJECT (this, "opening sending client socket to %s:%d", this->host,
      this->port);
  if ((this->sock_fd.fd = socket (AF_INET, SOCK_STREAM, 0)) == -1) {
    GST_ELEMENT_ERROR (this, RESOURCE, OPEN_WRITE, (NULL), GST_ERROR_SYSTEM);
    return FALSE;
  }

  setsockopt (this->sock_fd.fd, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout,
sizeof(timeout));

  GST_DEBUG_OBJECT (this, "opened sending client socket with fd %d",
      this->sock_fd.fd);
  ...
----------------------------------------

Now my application is capable of shutting down within approximately one minute
(acceptable for my situation).  I understand 0.10 is no longer maintained and
that you probably have no interested in this change, but I thought I would pass
it along.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- 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