forked from tumtumtum/StreamingKit
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from GlobalRadio/retry_connection_when_no_network
Retry connection when no network
- Loading branch information
Showing
2 changed files
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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"); | ||
|
||
|