'Idempotently forget a port, closing the listen socket at most once.'

def forget_port(self, port):

    orphan_data = self.sock_data_by_port.pop(port, None)
    if orphan_data:
        greenio.shutdown_safe(orphan_data['sock'])
        orphan_data['sock'].close()
        self.logger.notice('Closing    unnecessary    sock    for    port    %d', port)
