Lorenzo is seeing some problems closing a port when an incoming mcast connection is flakey. He found that the problem can be made more replicable by reducing the system buffer size:
>If I run the same test on my laptop (Linux Ubuntu) things work ok. However I manage to replicate the problem with the framerate (the fact that it does not shutdown correctly), if I reduce the receiver buffer.
> sudo /sbin/sysctl net.core.rmem_max=51200
> sudo /sbin/sysctl net.core.rmem_max=40960
> I see more and more packets being lost, but the program still quits ok.
> when I go down to 30720 I start see the problem I described above.