NativeGrpcStream class final
GrpcStream of dox_http_native.
The native server gives an HTTP/2 request with content-type: application/grpc* as a stream of body parts (NativeRequest.isStreamed).
A request that ends on its HEADERS is a normal request with an empty
body. Both are read the same way: listen to the request.
- Inheritance
-
- Object
- GrpcStream
- NativeGrpcStream
Constructors
- NativeGrpcStream(NativeRequest request)
Properties
-
body
→ Stream<
Uint8List> -
The native server acks a part only after the listener took it.
no setteroverride
-
gone
→ Future<
void> -
Completes once, when the client is gone (it reset the stream or the
connection died) before the answer was sent. Never completes for an
answer that ends normally.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasRoom → bool
-
True when the server has room for more answer bytes, so a flush
would complete at once. Before the first part it is false: the
first flush starts the stream.
no setteroverride
- headSent → bool
-
true once the status and the headers went out
no setteroverride
- isHttp2 → bool
-
true when the client used HTTP/2. gRPC needs it for the trailers.
no setteroverride
- remoteAddress → InternetAddress?
-
the address of the client, when known
no setteroverride
- requestHeaders → HttpHeaders
-
the request headers. Names are lower case.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- wholeBody → Uint8List?
-
The whole body, when it came with the request (eg. a body of one
DATA frame, the usual unary call). Else null: listen to body.
no setteroverride
Methods
-
add(
List< int> bytes) → void -
Adds body bytes. They go out on flush or at the end.
override
-
end(
) → void -
Ends the answer. Trailers set with setTrailer go out after the body.
override
-
flush(
) → Future< void> -
Sends what was added. Completes when the server has room for more,
so a fast writer waits for a slow client.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reject(
int status, String text) → void -
A plain HTTP answer, for requests that are not gRPC at all.
override
-
setHeader(
String name, String value) → void -
override
-
setOkTrailer(
) → void -
Ends with
grpc-status: 0, after the trailers set so far.override -
setTrailer(
String name, String value) → void -
override
-
start(
int status, {bool gzip = false}) → void -
Starts the answer with
status, the gRPC content type andgrpc-accept-encoding(andgrpc-encoding: gzipwhengzip), and the headers set so far.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited