我正在使用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在本地运行时,服务器工作正常。为什么会这样?