com.squareup.okhttp.internal.spdy.SpdyStream Java Examples

The following examples show how to use com.squareup.okhttp.internal.spdy.SpdyStream. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SpdyTransport.java    From cordova-android-chromeview with Apache License 2.0 5 votes vote down vote up
@Override public boolean makeReusable(boolean streamCancelled, OutputStream requestBodyOut,
    InputStream responseBodyIn) {
  if (streamCancelled) {
    if (stream != null) {
      stream.closeLater(SpdyStream.RST_CANCEL);
      return true;
    } else {
      // If stream is null, it either means that writeRequestHeaders wasn't called
      // or that SpdyConnection#newStream threw an IOEXception. In both cases there's
      // nothing to do here and this stream can't be reused.
      return false;
    }
  }
  return true;
}
 
Example #2
Source File: SpdyTransport.java    From phonegap-plugin-loading-spinner with Apache License 2.0 5 votes vote down vote up
@Override public boolean makeReusable(boolean streamCancelled, OutputStream requestBodyOut,
    InputStream responseBodyIn) {
  if (streamCancelled) {
    if (stream != null) {
      stream.closeLater(SpdyStream.RST_CANCEL);
      return true;
    } else {
      // If stream is null, it either means that writeRequestHeaders wasn't called
      // or that SpdyConnection#newStream threw an IOEXception. In both cases there's
      // nothing to do here and this stream can't be reused.
      return false;
    }
  }
  return true;
}