mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
rtspconnection: add OSX specific hack to detect when a connection is refused
Unlike linux, OSX wakes up select with POLLOUT (instead of POLLERR) when connect() is done async and the connection is refused. Therefore always check for the socket error state using getsockopt (..., SO_ERROR, ...) after a connection attempt.
This commit is contained in:
parent
59f2249284
commit
22cc529409
1 changed files with 8 additions and 0 deletions
|
@ -592,6 +592,14 @@ do_connect (const gchar * ip, guint16 port, GstPollFD * fdout,
|
|||
getsockopt (fd, SOL_SOCKET, SO_ERROR, (char *) &errno, &len);
|
||||
#endif
|
||||
goto sys_error;
|
||||
} else {
|
||||
#ifdef __APPLE__
|
||||
/* osx wakes up select with POLLOUT if the connection is refused... */
|
||||
socklen_t len = sizeof (errno);
|
||||
getsockopt (fd, SOL_SOCKET, SO_ERROR, (char *) &errno, &len);
|
||||
if (errno != 0)
|
||||
goto sys_error;
|
||||
#endif
|
||||
}
|
||||
|
||||
gst_poll_fd_ignored (fdset, fdout);
|
||||
|
|
Loading…
Reference in a new issue