Skip to content

Commit

Permalink
infinite reconnection option
Browse files Browse the repository at this point in the history
  • Loading branch information
lotharthesavior committed Jan 14, 2023
1 parent 6cee4ac commit c019909
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) principles.

## [0.0.4] - 2023-01-14

### Added

- Added infinite reconnection attempts option.

## [0.0.3] - 2022-10-16

### Added
Expand All @@ -18,4 +24,4 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi

### Initial version

- Fully functional server-side Websocket Client ready for [Socket Conveyor](https://socketconveyor.com).
- Fully functional server-side Websocket Client ready for [Socket Conveyor](https://socketconveyor.com).
5 changes: 4 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ public function connect()

if (
$this->reconnect
&& $this->reconnectionAttemptsCount < $this->reconnectionAttempts
&& (
$this->reconnectionAttemptsCount < $this->reconnectionAttempts
|| -1 === $this->reconnectionAttempts
)
) {
sleep($this->reconnectionInterval);
echo 'Reconnecting (attempt ' . $this->reconnectionAttemptsCount . ')...' . PHP_EOL;
Expand Down

0 comments on commit c019909

Please sign in to comment.