JHnatow
JHnatow

Reputation: 61

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?

Upvotes: 4

Views: 795

Answers (2)

Martin Müller
Martin Müller

Reputation: 21

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.

Upvotes: 2

Tobi482
Tobi482

Reputation: 11

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.

Upvotes: 1

Related Questions