Skip to content

Commit

Permalink
Merge pull request #21 from GlobalRadio/retry_connection_when_no_network
Browse files Browse the repository at this point in the history
Retry connection when no network
  • Loading branch information
iamszabo authored Dec 7, 2022
2 parents 90b6e4a + 60989ca commit df16d6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions StreamingKit.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = "StreamingKit"
s.version = "2.4.23"
s.version = "2.4.24"
s.summary = "A fast and extensible audio streamer for iOS and OSX with support for gapless playback and custom (non-HTTP) sources."
s.homepage = "https://github.com/tumtumtum/StreamingKit/"
s.license = 'MIT'
s.author = { "Thong Nguyen" => "[email protected]" }
s.source = { :git => "https://github.com/GlobalRadio/StreamingKit.git", :tag => "guac_2.4.23"}
s.source = { :git => "https://github.com/GlobalRadio/StreamingKit.git", :tag => "guac_#{s.version}"}
s.platform = :ios
s.requires_arc = true
s.source_files = 'StreamingKit/StreamingKit/*.{h,m}'
Expand Down
4 changes: 3 additions & 1 deletion StreamingKit/StreamingKit/STKAutoRecoveringHTTPDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ This product includes software developed by Thong Nguyen ([email protected])
#define DEFAULT_WATCHDOG_PERIOD_SECONDS (8)
#define DEFAULT_INACTIVE_PERIOD_BEFORE_RECONNECT_SECONDS (15)

static const uint HTTP_RESPONSE_NOT_RECEIVED = 0;

static uint64_t GetTickCount(void)
{
static mach_timebase_info_data_t sTimebaseInfo;
Expand Down Expand Up @@ -372,7 +374,7 @@ -(void) dataSourceEof:(STKDataSource*)dataSource
-(void) dataSourceErrorOccured:(STKDataSource*)dataSource
{
const UInt32 httpStatusCode = self.innerDataSource.httpStatusCode;
const bool isRetryableStatus = httpStatusCode >= 200 && httpStatusCode < 300;
const bool isRetryableStatus = (httpStatusCode >= 200 && httpStatusCode < 300) || httpStatusCode == HTTP_RESPONSE_NOT_RECEIVED;

NSLog(@"Error on source %@ with http status %@ – will %@.", dataSource, @(httpStatusCode), isRetryableStatus ? @"retry" : @"fail");

Expand Down

0 comments on commit df16d6e

Please sign in to comment.