Open mcginty opened 8 years ago
Yeah, this matches what I've seen myself. For example: https://github.com/eminence/udt-rs/blob/master/tests/test.rs#L11-L15
I admit I don't know why this is necessary
I found this post on the UDT mailing list that talks about this issue:
Yes, this is a known issue too (I should have add a known issue list...)
The reason is that UDT tries to allocate a rather large socket buffer
(setsockopt) that OS X does not support. On Linux or Windows, they will
set the socket buffer to the maximum system value; however, OS X will
return error.
So the solution is, you can either change your system parameter to allow
larger socket buffer size (at least 20MB), or set UDT option (UDT_SNDBUF
and UDT_RCVBUF) to smaller values (e.g., 64KB). See the commented
setsockopt lines in appserver and appclient for examples.
Since this is a known UDT issue, I'm going to find a way to document this and then close this issue.
(As you seem to be the only user of udt-rs at the moment, I'm happy to take suggestions regarding the best/most visible way to document this :smile: )
I wonder if this is something that udt-rs can do by default using some platform-specific code when built for OS X?
Anyone work out a fix or work around for this?
@winkmichael iirc, the workaround was to set the sockopt as mentioned in that first issue description.
I'm getting an error when calling
socket.listen()
on OS X:UNLESS I specify
then everything works like magic.