Socket refactoring: using separate module for multicast support