Properly release socket