Add |end_of_stream| flag to on_read_completed() C callback |
|
Issue descriptionCronet Java API passes |endOfStream| flag to the onReadCompleted() bidirectional stream callback. This makes it very easy for the client to determine that the end of stream has been reached and onSucceeded() callback will be fired shortly (if write is completed too): https://cs.chromium.org/chromium/src/components/cronet/android/api/src/org/chromium/net/BidirectionalStream.java?sq=package:chromium&l=254 public abstract void onReadCompleted(BidirectionalStream stream, UrlResponseInfo info, ByteBuffer buffer, boolean endOfStream); On iOS, in order to detect the end of stream and trigger the on_succeded() callback, the client needs to call read() until 0 bytes are received. This makes the client logic more complicated. It is also not obvious that on_succeded() may not be called even if all data were read: https://cs.chromium.org/chromium/src/components/cronet/ios/cronet_c_for_grpc.h?sq=package:chromium&l=77 void (*on_read_completed)(cronet_bidirectional_stream* stream, char* data, int bytes_read); We need to add |end_of_stream| flag to the C API callback and make it consistent with the Java API. |
|
►
Sign in to add a comment |
|
Comment 1 by kapishnikov@chromium.org
, Aug 16 2016