It's needed to prevent the garbage collector from destroying the socket objects.