Made socket objects instantiated within loop.