Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pymodbus/client/tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ async def _connect(self):
"""Connect."""
_logger.debug("Connecting.")
try:
transport, protocol = await self.loop.create_connection(
self._create_protocol, host=self.params.host, port=self.params.port
transport, protocol = await asyncio.wait_for(
self.loop.create_connection(
self._create_protocol, host=self.params.host, port=self.params.port
),
timeout=self.params.timeout,
)
return transport, protocol
except Exception as exc: # pylint: disable=broad-except
Expand Down