You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which causes all sorts of weird behaviors. E.g. the following sample demonstrates an infinite hang in case when server closes connection before sending all the data. Otherwise if client is the only async "thread" in the process, the client will occasionally fail with error "No handles or timers registered in dispatcher." with totally irrelevant stack trace.
import asynchttpserver, httpclient, asyncdispatch
procstartServer() {.async.} =proccb(req: Request) {.async.} =let headers = { "Content-length": "15"} # Provide invalid content-lengthawait req.respond(Http200, "Hello World", headers.newHttpHeaders())
var server =newAsyncHttpServer()
await server.serve(Port(5555), cb)
procrunClient() {.async.} =let c =newAsyncHttpClient(headers = {"Connection": "close"}.newHttpHeaders)
let r =await c.getContent("http://127.0.0.1:5555")
echo r
asyncCheckstartServer()
waitForrunClient()
The text was updated successfully, but these errors were encountered:
Which causes all sorts of weird behaviors. E.g. the following sample demonstrates an infinite hang in case when server closes connection before sending all the data. Otherwise if client is the only async "thread" in the process, the client will occasionally fail with error "No handles or timers registered in dispatcher." with totally irrelevant stack trace.
The text was updated successfully, but these errors were encountered: