我正在使用 nim buildpack 在 heroku 上运行一个简单的 jester 服务器。但是,asyncnet 库有时会拒绝使用 heroku 提供的端口(每次都不同)。如果 nim 不喜欢该端口,会发生以下情况:
Traceback (most recent call last)
macros.nim(293) blog
jester.nim(326) serve
asyncdispatch.nim(282) asyncCheck
asyncdispatch.nim(224) callback=
asyncdispatch.nim(286) :anonymous
Error: unhandled exception: value ot of range: 58622 [Exception]
Original stack trace in serve:
Traceback (most recent call last)
macros.nim(293) blog
jester.nim(326) serve
asyncdispatch.nim(1212) serve
asyncdispatch.nim(1199) cb
asyncnet.nim(433) bindAddr
asynchttpserver.nim(250) serveIter
Continuing...
(我确定 58622 是 heroku 试图为程序提供数据的端口。)当我使用端口 58622 在本地运行时,服务器工作正常。为什么会这样?