NativeServerAdapter class
ServerAdapter of dox_http_native: Rust owns the sockets
- Inheritance
-
- Object
- ServerAdapter
- NativeServerAdapter
Constructors
- NativeServerAdapter()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- needsReusePort → bool
-
True when each isolate binds its own listener on the port, with
SO_REUSEPORT. Windows has none: there one isolate serves. False: the
isolates of the process share one listener.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addFile(
HttpResponse res, String path, int start, int length) → Future< void> ? -
Sends
lengthbytes of the file atpathfromstartas the body ofres. null when the server can not do it: Dart streams the file.override -
answerStarted(
HttpResponse res) → bool -
true when the head of
resis sent orresis closedoverride -
bind(
int port, Object? address, ServerSettings settings) → Future< HttpServer> -
A server on
portwithsettings.override -
checkTls(
ServerTls tls) → void -
Throws a
TlsExceptionwhen the files oftlsare bad.override -
closeGracefully(
HttpServer server) → Future< void> -
Stops
servertaking new connections. Completes when its open requests are done.inherited -
end(
HttpResponse res) → void -
sends
reswith no Future; another response is closedoverride -
ensureAvailable(
) → void -
Throws when the server can not run here, with the reason.
override
-
fixedHeaders(
HttpHeaders headers) → bool -
true when
headersare request headers of the server: they can not changeoverride -
grpcStream(
HttpRequest req) → GrpcStream? -
The gRPC call of
req, a request of the server. null when the server has no gRPC (eg. no HTTP/2): dox_grpc answers 505.override -
headSent(
HttpResponse res) → bool -
true when the head of
resalready went outoverride -
heldBody(
HttpRequest req) → Uint8List? -
the whole body when the server holds it already, else null: it
streams
override
-
isTls(
HttpServer server) → bool -
true when
serverspeaks HTTPSoverride -
isWebSocketUpgrade(
HttpRequest req) → bool -
true when
reqasks for a WebSocket upgradeoverride -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openFile(
HttpRequest req, List< String> paths, String folder) → FutureOr<ServerFile?> -
Opens the first of
paths[1..]that is there, elsepaths[0]. null whenpaths[0]is not there (or no regular file), a FileSystemException when it can not be opened. Needs owns.override -
owns(
HttpResponse res) → bool -
True when
resis a response of the server: it copies the body when it ends (see takeBody) and sends files itself (see openFile).override -
path(
HttpRequest req) → String -
The path of
req, with no query. The same asreq.uri.path, with no Uri made.override -
plainQuery(
HttpRequest req) → String? -
the query text of a plain target, else null: read
uri.queryoverride -
readBody(
HttpRequest req, int max) → Future< Uint8List> ? -
NativeRequest.readBodyputs the parts of a big body in one buffer of native memory, so a big body is no big list on the Dart heap.override -
reloadCertificate(
HttpServer server) → Future< void> -
reads the certificate files of
serveragainoverride -
scheme(
HttpRequest req) → String? -
httpswhen the port ofreqhas TLS,httpwhen not, null for a request of another serveroverride -
takeBody(
HttpResponse res) → void -
lets go of the body of
res, after it ended. Needs owns.override -
tlsFiles(
HttpServer server) → ServerTls? -
the TLS files of
server, else nulloverride -
toString(
) → String -
A string representation of this object.
inherited
-
trailers(
HttpResponse res) → HttpHeaders? -
The trailers of
res: they go out after the body on HTTP/2, and are dropped on HTTP/1.1. null when the server sends no trailers.override -
upgradeWebSocket(
HttpRequest req, String? protocol, int maxMessageSize) → Future< WebSocket> -
accepts the WebSocket upgrade of
reqoverride
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited