mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
Added close() to async versions of scgi and httpserver.
This commit is contained in:
@@ -499,9 +499,13 @@ proc asyncHTTPServer*(handleRequest: proc (server: PAsyncHTTPServer, client: TSo
|
||||
result = capturedRet
|
||||
|
||||
proc register*(d: PDispatcher, s: PAsyncHTTPServer) =
|
||||
## Registers a PAsyncHTTPServer with a PDispatcher.
|
||||
## Registers a ``PAsyncHTTPServer`` with a ``PDispatcher``.
|
||||
d.register(s.asyncSocket)
|
||||
|
||||
|
||||
proc close*(h: PAsyncHTTPServer) =
|
||||
## Closes the ``PAsyncHTTPServer``.
|
||||
h.asyncSocket.close()
|
||||
|
||||
when isMainModule:
|
||||
var counter = 0
|
||||
|
||||
|
||||
@@ -183,6 +183,10 @@ proc register*(d: PDispatcher, s: PAsyncScgiState): PDelegate {.discardable.} =
|
||||
## Registers ``s`` with dispatcher ``d``.
|
||||
result = d.register(s.asyncServer)
|
||||
|
||||
proc close*(s: PAsyncScgiState) =
|
||||
## Closes the ``PAsyncScgiState``.
|
||||
s.asyncServer.close()
|
||||
|
||||
when false:
|
||||
var counter = 0
|
||||
proc handleRequest(client: TSocket, input: string,
|
||||
|
||||
Reference in New Issue
Block a user