public function ping($addr, $cb)
    {
        $e = explode(':', $addr);
        $this->getConnection('valve://[udp:' . $e[0] . ']' . (isset($e[1]) ? ':' . $e[1] : '') . '/ping',
            function ($conn) use ($cb) {
                if (!$conn->connected) {
                    $cb($conn, false);
                    return;
                }
                $mt = microtime(true);
                $conn->request('ping', null, function ($conn, $success) use ($mt, $cb) {
                    $cb($conn, $success ? (microtime(true) - $mt) : false);
                });
            });
    }
public function ping($addr, $cb)
    {
        $e = explode(':', $addr);
        $this->getConnection('valve://[udp:' . $e[0] . ']' . (isset($e[1]) ? ':' . $e[1] : '') . '/ping',
            function ($conn) use ($cb) {
                if (!$conn->connected) {
                    $cb($conn, false);
                    return;
                }
                $mt = microtime(true);
                $conn->request('ping', null, function ($conn, $success) use ($mt, $cb) {
                    $cb($conn, $success ? (microtime(true) - $mt) : false);
                });
            });
    }
public function ping ( $ addr , $ cb ) { $ e = explode ( ':' , $ addr ) ; $ this -> getConnection ( 'valve://[udp:' . $ e [ 0 ] . ']' . ( isset ( $ e [ 1 ] ) ? ':' . $ e [ 1 ] : '' ) . '/ping' , function ( $ conn ) use ( $ cb ) { if ( ! $ conn -> connected ) { $ cb ( $ conn , false ) ; return ; } $ mt = microtime ( true ) ; $ conn -> request ( 'ping' , null , function ( $ conn , $ success ) use ( $ mt , $ cb ) { $ cb ( $ conn , $ success ? ( microtime ( true ) - $ mt ) : false ) ; } ) ; } ) ; }
Sends echo-request
@param  string $addr Address
@param  callable $cb Callback
@callback $cb ( )
@return void
Sends echo - request