Class Ping
- java.lang.Object
-
- com.squareup.okhttp.internal.framed.Ping
-
public final class Ping extends Object
A locally-originated ping.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longroundTripTime()Returns the round trip time for this ping in nanoseconds, waiting for the response to arrive if necessary.longroundTripTime(long timeout, TimeUnit unit)Returns the round trip time for this ping in nanoseconds, or -1 if the response was canceled, or -2 if the timeout elapsed before the round trip completed.
-
-
-
Method Detail
-
roundTripTime
public long roundTripTime() throws InterruptedExceptionReturns the round trip time for this ping in nanoseconds, waiting for the response to arrive if necessary. Returns -1 if the response was canceled.- Throws:
InterruptedException
-
roundTripTime
public long roundTripTime(long timeout, TimeUnit unit) throws InterruptedExceptionReturns the round trip time for this ping in nanoseconds, or -1 if the response was canceled, or -2 if the timeout elapsed before the round trip completed.- Throws:
InterruptedException
-
-