Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果程序正在运行,我如何更新在 pymodbus 中配置的服务器的地址?我试图停止服务器并重新启动它,但出现错误。
有什么建议么?
如果您在 Linux 中工作并在没有正确关闭的情况下终止服务器,则必须在控制台中写入exit以刷新套接字。
exit
对于 Windows,您可能必须完全关闭控制台窗口。
如果您处理关闭连接的方式,或者甚至重用您的套接字,这将有所帮助,请参见此处:
如何在 python 程序中关闭 Ctrl-C 上的套接字连接