Task that ensures Pings are sent periodically to the distant server
        :return:
185088
async def _do_ping(self):
        
        try:
            while True:
                await asyncio.sleep(1)
                if self._ping_count > 10:
                    await self._reconnect()
                else:
                    self._ping_count += 1
                    await ZMQUtils.send(self._socket, Ping())
        except asyncio.CancelledError:
            return
        except KeyboardInterrupt:
            return
864850
async def handle_client_ping(self, client_addr, _: Ping):
        
        await ZMQUtils.send_with_addr(self._client_socket, client_addr, Pong())
885149
def on_ping(self, data):
        
        self.log.debug('jupyter_server_proxy: on_ping: {}'.format(data))
        self._record_activity()
        if hasattr(self, 'ws'):
            self.ws.protocol.write_ping(data)
1012010
def ping(self):
        

        # Make sure we're connected
        if not self.conn:
            self.connect()

        # Send the ping and wait for the response
        self.conn.send('PING', time.time())
        cmd, payload = self.conn.recv()
        recv_ts = time.time()

        # Make sure the response was a PONG
        if cmd != 'PONG':
            raise Exception("Invalid response from server")

        # Return the RTT
        return recv_ts - payload[0]
1250435
def send_ping(self, payload=''):
        
        self.send_frame(ControlFrame(OPCODE_PING, payload),
                        lambda: self.onping(payload))
        self.ping_payload = payload
        self.ping_sent = True
1130140
def idle_task(self):
        ''''''
        now = time.time()

        if now-self.last_sent > self.system_time_settings.interval:
            self.last_sent = now
            time_us = time.time() * 1000000
            if self.system_time_settings.verbose:
                print("ST: Sending system time: (%u/%u)" %
                      (time_us, self.uptime(),))
            self.master.mav.system_time_send(time_us,
                                             self.uptime())

        if (now-self.last_sent_timesync >
            self.system_time_settings.interval_timesync):
            self.last_sent_timesync = now
            time_ns = time.time() * 1000000000
            time_ns += 1234
            if self.system_time_settings.verbose:
                print("ST: Sending timesync request")
            self.master.mav.timesync_send(0, time_ns)
            self.last_sent_ts1 = time_ns
913389
def ping():
    '''
    
    '''
    try:
        out, err = DETAILS['server'].sendline('help')
        return True
    except TerminalException as e:
        log.error(e)
        return False
1324239
def ping(self):
        
        d = self.replyQueue.get_ping()
        packet = RequestPing(self.charset, self.errors)
        self.transport.write(bytes(packet))
        return d.addCallback(self.handle_reply, self.charset, self.errors, None)
252126
async def _perform_ping_timeout(self, delay: int):
        

        # pause for delay seconds
        await sleep(delay)
        # then continue
        error = TimeoutError(
            'Ping timeout: no data received from server in {timeout} seconds.'.format(
                timeout=self.PING_TIMEOUT))
        await self.on_data_error(error)
996094
async def _pinger(self):
        '''
        

        '''
        async def _do_ping():
            try:
                await pinger_facade.Ping()
                await asyncio.sleep(10, loop=self.loop)
            except CancelledError:
                pass

        pinger_facade = client.PingerFacade.from_connection(self)
        try:
            while True:
                await utils.run_with_interrupt(
                    _do_ping(),
                    self.monitor.close_called,
                    loop=self.loop)
                if self.monitor.close_called.is_set():
                    break
        except websockets.exceptions.ConnectionClosed:
            # The connection has closed - we can't do anything
            # more until the connection is restarted.
            log.debug('ping failed because of closed connection')
            pass
472373
function ping(req, res) {
  if (url.parse(req.url).pathname == '/ping') {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('OK');
    return true;
  }
  return false;
}
983200
def _ping_loop(self):
        
        self.pong_received = True
        self.ping_loop_event.clear()
        while self.state == 'connected':
            if not self.pong_received:
                self.logger.info(
                    'PONG response has not been received, aborting')
                if self.ws:
                    self.ws.close()
                self.queue.put(None)
                break
            self.pong_received = False
            self._send_packet(packet.Packet(packet.PING))
            self.ping_loop_event.wait(timeout=self.ping_interval)
        self.logger.info('Exiting ping task')
1130217
def ping(self, event):
        """"""

        self.log('Client ping received:', event.data, lvl=verbose)
        response = {
            'component': 'hfos.ui.clientmanager',
            'action': 'pong',
            'data': [event.data, time() * 1000]
        }

        self.fire(send(event.client.uuid, response))
1241190
def ping():
    '''
    
    '''
    try:
        session, cookies, csrf_token = logon()
        logout(session, cookies, csrf_token)
    except salt.exceptions.CommandExecutionError:
        return False
    except Exception as err:
        log.debug(err)
        return False
    return True
514251
def ping():
    '''
    
    '''
    if _worker_name() not in DETAILS:
        init()
    try:
        return DETAILS[_worker_name()].conn.isalive()
    except TerminalException as e:
        log.error(e)
        return False
1043712
def ping(self):
        
        start = time.time()
        self._conn.ping()
        return (time.time() - start)
1272218
def ping(**kwargs):
    '''
    
    '''
    status = True
    try:
        nodes(**kwargs)
    except CommandExecutionError:
        status = False

    return status