fix error about AttributeError: 'socket' object has no attribute 'cfg_addr'