sergey-dryabzhinsky / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
1.02k stars 214 forks source link

push_reconnect does not resolve DNS address on reconnect #128

Open winkmichael opened 8 years ago

winkmichael commented 8 years ago

Hello Sergey,

We've been finding that during a push_reconnect event nginx-rtmp isn't resolving the DNS address again, it uses the same resolved ip addresses. Ideally it will do a DNS lookup every time the push_reconnect even is triggered.

I believe setting reuseaddr to 0 by default in ngx_rtmp_auto_push_module.c should be the default nature. I suppose it could be exposed as a config parameter, but I think in nearly all cases re-resolving the address is the better behavior.

Thanks so much, Mike

chriswiggins commented 8 years ago

Mike, doesn't SO_REUSEADDR only relate to the local listening address? Have you tried changing it to 0 to see the outcome? If you do let us know and we can add it as a configuration option

winkmichael commented 7 years ago

Yes, 0 is best. It will look up each time.