简体   繁体   中英

Multicast socket.close takes 3 minutes with TTL>1

On certain Windows machines, I'm seeing a multicast socket.close call take ~3 minutes.

This is reproducible in both Java and .NET across various different kinds of NICs and Windows flavors.

It's not reproducible on most machines, but the ones that have it seem to follow the same pattern. A TTL>1 causes the 3 minute socket.close and any TTL==1 seems to close the socket almost instantly.

My questions are is anyone else seeing this issue and does anyone know why it's happening?

I think I've solved the mystery of Socket.Close() taking 3 minutes to complete when using a multicast TTL>1: It occurs every time the routing and RAS service (RRAS) has been started. This KB entry explains it and gives a hotfix: http://support.microsoft.com/kb/2555948/en-us

Using netsh interface ipv4 set global multicastforwarding=disabled in an admin shell brings Socket.Close() time back to normal.

Yeah, I can confirm this. Same behavior in C++ on Windows 7 on UDP sockets. I've discovered that not joining the same multicast group you are sending to solves the problem on my project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM