我在 Mac 上使用套接字启动应用程序并返回以下内容:
kukodajanos@Kukodas-MacBook-Pro niots % swift run
Building for debugging...
[2/2] Emitting module niots
Build complete! (0.30s)
Server started and listening on [IPv6]::1/::1:8888
尝试像这样连接,它启动,但没有返回任何响应,知道出了什么问题吗?
kukodajanos@Kukodas-MacBook-Pro ~ % nc -lp 8888
rrrr
我也试过这个设置:
kukodajanos@Kukodas-MacBook-Pro ~ % nc ::1 8888
Error: Couldn't resolve host "::1"
这是我正在检查的应用程序代码:https ://rderik.com/blog/understanding-swiftnio-by-building-a-text-modifying-server/