Server class

An adapter with a concrete URL.

The most basic definition of "adapter" includes any function that passes incoming requests to a Handler and passes its responses to some external client. However, in practice, most adapters are also servers—that is, they're serving requests that are made to a certain well-known URL.

This interface represents those servers in a general way. It's useful for writing code that needs to know its own URL without tightly coupling that code to a single server implementation.

There are two built-in implementations of this interface. You can create a server backed by dart:io using IOServer, or you can create a server that's backed by a normal Handler using ServerHandler.

Implementations of this interface are responsible for ensuring that the members work as documented.





url → Uri
The URL of the server. [...]
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited


close() → Future
Closes the server and returns a Future that completes when all resources are released. [...]
mount(Handler handler) → void
Mounts handler as the base handler for this server. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toString() → String
Returns a string representation of this object.


operator ==(dynamic other) → bool
The equality operator.