///|
async test "listener errors are distinct from connection errors" {
try @server.serve(_ => @http.Response::new(204), addr="invalid") catch {
@server.Bind(..) => ()
error => raise error
} noraise {
_ => fail("invalid address accepted")
}
}pub(all) suberror ListenError {
Config(ServerConfigError)
Bind(detail~ : String)
Accept(detail~ : String)
} derive(Debug)async fn serve(handler : async (Request) -> Response noraise, addr~ : String, limits? : ServerLimits, on_listen? : (String) -> Unit, on_error? : (TransportError) -> Unit) -> Unit raise ListenErrorInstall
Download zipmoonbitlang/core/async adapters for gaato/http: TCP and TLS connections, a client backend, a server listener, content codings and a JS fetch backend.