-
Notifications
You must be signed in to change notification settings - Fork 865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Connection timeout on macOS when using acquired UDP socket #2178
Comments
@maxsharabayko I think it should be mentioned in the documentation that I think this thing isn't BSD specific at all - it's also mentioned in the Linux manpage:
The matter is then that we do not support connected sockets in I've read a bit the documentation of the UDP support in Go library and I think I understand why you call
So, maybe there's a way to "unconnect" this socket by calling Just one more thing - if you use |
Thanks for the feedback, I think I was mainly confused by Go's semantics for connected/unconnected sockets. If I use This isn't an issue for me currently, but I suppose I could see a use case where SRT can take over a connected socket and use |
Describe the bug
On macOS, using
srt_bind_acquire
followed bysrt_connect
will fail withSRT_ENOSERVER
.To Reproduce
Steps to reproduce the behavior:
srtgo
with the following snippet to connect to the destination and return the socket's file descriptor:srt_bind_acquire
on the UDP socket.srt_connect
to attempt to connect to the server.SRT_ENOSERVER
should be returned.Expected behavior
The UDP socket will be properly reused by the SRT library as the client socket. I'm not totally sure this is supported behavior, but it works when running on Linux.
Desktop (please provide the following information):
Additional context
I've narrowed this down to a difference in the
sendmsg
syscall between Linux and macOS/FreeBSD. On macOS, callingsendmsg
on a connected socket with a destination address inmsghdr
will fail withEISCONN
. Per the FreeBSDsendmsg
man page:Per the Linux
sendmsg
man page:The
srt::CChannel::sendto
function always sets the destination address in itssendmsg
call.I'm not much of a C developer, but I was able to get around this issue by replacing the
sendmsg
call with the following:I imagine this is a non-optimal solution to the problem, but it demonstrates the cause of the issue.
The text was updated successfully, but these errors were encountered: