Possibly strange behaviour of pymodbus.server.simulator.http_server.ModbusSimulatorServer #1763
Answered
by
janiversen
frisellcpl
asked this question in
Q&A
-
I use the .run_forever() method of ModbusSimulator to start and serve my server. However I found the code to call the asyncio.Future() object stored in self.serving: self.serving: asyncio.Future = asyncio.Future()
...
async def run_forever(self, only_start=False):
"""Start modbus and http servers."""
try:
runner = web.AppRunner(self.web_app)
await runner.setup()
self.site = web.TCPSite(runner, self.http_host, self.http_port)
await self.site.start()
except Exception as exc:
Log.error("Error starting http server, reason: {}", exc)
raise exc
Log.info("HTTP server started on ({}:{})", self.http_host, self.http_port)
if only_start:
return
while True:
await self.serving() It seems to me that the asyncio.Future object is declared and should only be awaited, like: await self.serving But I'm not experienced enough in pymodbus to tell, hence a discussion thread rather than an issue to start with. |
Beta Was this translation helpful? Give feedback.
Answered by
janiversen
Sep 6, 2023
Replies: 3 comments 1 reply
-
Please see our example. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
janiversen
-
This looks like a bug, pull requests are welcome. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please see our example.