Skip to content

Commit

Permalink
Merge pull request #8 from Wizard1209/fix/send-no-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout authored Nov 30, 2023
2 parents 591c4a7 + 9a2aa0c commit bfb5fde
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pysignalr/transport/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ async def _set_state(self, state: ConnectionState) -> None:
self._state = state

async def _get_connection(self) -> WebSocketClientProtocol:
await self._connected.wait()
try:
await asyncio.wait_for(self._connected.wait(), self._connection_timeout)
except asyncio.TimeoutError as e:
raise RuntimeError('The socket was never run') from e
if not self._ws or self._ws.state != State.OPEN:
raise RuntimeError('Connection is closed')
return self._ws
Expand Down

0 comments on commit bfb5fde

Please sign in to comment.