Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry the connection #433

Closed
mikhn0 opened this issue Nov 28, 2017 · 1 comment
Closed

Retry the connection #433

mikhn0 opened this issue Nov 28, 2017 · 1 comment

Comments

@mikhn0
Copy link

mikhn0 commented Nov 28, 2017

Hello dear developers!🙂
I use your framework v2.1.1 in my project. And try to catch different states of connection.
As I see in method open func stream(_ aStream: Stream, handle eventCode: Stream.Event) we receive event that detects the kind of connection state and what we have to do. If I has internet connection at the start of the app, but then disable the internet and after that try to enable the internet - above method doesn't call. And sometimes it works correctly..

And also I always receive the same logs:
2017-11-28 20:28:16.871830+0300 Startscream_Test[654:767010] open on /var/mobile/Containers/Data/Application/FF1717DD-D983-4949-8939-53C7F6F02DD5/Documents/default.realm: File exists error copying seeds: Error Domain=NSCocoaErrorDomain Code=516 "“Startscream2.realm” couldn’t be copied to “Documents” because an item with the same name already exists." UserInfo={NSSourceFilePathErrorKey=/var/containers/Bundle/Application/43FA5EB4-6373-45B7-9797-F1FFC25012EE/Startscream_Test.app/Startscream2.realm, NSUserStringVariant=( Copy ), NSDestinationFilePath=/var/mobile/Containers/Data/Application/FF1717DD-D983-4949-8939-53C7F6F02DD5/Documents/default.realm, NSFilePath=/var/containers/Bundle/Application/43FA5EB4-6373-45B7-9797-F1FFC25012EE/Startscream_Test.app/Startscream2.realm, NSUnderlyingError=0x1c0458300 {Error Domain=NSPOSIXErrorDomain Code=17 "File exists"}} (CallManagerImpl.cpp:270): User config: {} [000:000] [771] (CallManagerImpl.cpp:47): Init: config_json: 2017-11-28 20:28:22.805413+0300 Startscream_Test[654:767010] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 2017-11-28 20:28:22.807564+0300 Startscream_Test[654:767010] [MC] Reading from public effective user settings. 2017-11-28 20:28:22.896321+0300 Startscream_Test[654:767010] [Crashlytics] Version 3.9.3 (128) 2017-11-28 20:29:21.797536+0300 Startscream_Test[654:767540] Task <40236176-4845-4239-A38C-CD531F285A21>.<1> finished with error - code: -1001 2017-11-28 20:29:21.834864+0300 Startscream_Test[654:767123] Task <40236176-4845-4239-A38C-CD531F285A21>.<1> HTTP load failed (error code: -999 [1:89]) 2017-11-28 20:29:21.865310+0300 Startscream_Test[654:767010] [MC] Lazy loading NSBundle MobileCoreServices.framework 2017-11-28 20:29:21.868182+0300 Startscream_Test[654:767010] [MC] Loaded MobileCoreServices.framework 2017-11-28 20:29:22.254318+0300 Startscream_Test[654:767193] TIC TCP Conn Failed [4:0x1c0173f80]: 3:-9800 Err(-9800) 2017-11-28 20:29:22.310887+0300 Startscream_Test[654:767010] Platon2 token: c01429910c938b5c63586c38d9b58bead1d37a3f3ca2b61340c51562e2a5fdaf 2017-11-28 20:29:22.318622+0300 Startscream_Test[654:767010] refreshPreferences: HangTracerEnabled: 0 2017-11-28 20:29:22.318672+0300 Startscream_Test[654:767010] refreshPreferences: HangTracerDuration: 500 2017-11-28 20:29:22.318690+0300 Startscream_Test[654:767010] refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0 2017-11-28 20:29:22.326931+0300 Startscream_Test[654:767142] TIC TCP Conn Failed [6:0x1c4171580]: 3:-9800 Err(-9800) 2017-11-28 20:29:22.401028+0300 Startscream_Test[654:767177] TIC TCP Conn Failed [8:0x1c4170e00]: 3:-9800 Err(-9800) 2017-11-28 20:29:22.401291+0300 Startscream_Test[654:767177] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9800) 2017-11-28 20:29:22.401365+0300 Startscream_Test[654:767177] Task <B3B9D6E8-D5F0-41C4-AF4E-092A5BB7D25C>.<2> HTTP load failed (error code: -1200 [3:-9800]) 2017-11-28 20:29:22.401682+0300 Startscream_Test[654:767142] Task <B3B9D6E8-D5F0-41C4-AF4E-092A5BB7D25C>.<2> finished with error - code: -1200 2017-11-28 20:29:35.684238+0300 Startscream_Test[654:767122] XPC connection interrupted 2017-11-28 20:30:48.830461+0300 Startscream_Test[654:767142] SocketStream read error [0x1c0171ac0]: 1 60 2017-11-28 20:30:48.833974+0300 Startscream_Test[654:767177] Task <C17AD512-7361-4EEA-95F5-3E54EFA1346D>.<1> finished with error - code: -1001 2017-11-28 20:30:48.866206+0300 Startscream_Test[654:767193] Task <C17AD512-7361-4EEA-95F5-3E54EFA1346D>.<1> HTTP load failed (error code: -1005 [1:57]) 2017-11-28 20:30:51.535594+0300 Startscream_Test[654:767122] TIC TCP Conn Failed [12:0x1c4175b40]: 1:50 Err(50) 2017-11-28 20:30:51.536185+0300 Startscream_Test[654:767193] [] nw_connection_get_connected_socket 11 Connection has no connected handler 2017-11-28 20:30:51.536260+0300 Startscream_Test[654:767193] TCP Conn 0x1c016f180 Failed : error 0:50 [50] 2017-11-28 20:30:59.026183+0300 Startscream_Test[654:767122] Task <7E12AC60-4E4C-4C3A-9BC4-85E753A3F534>.<3> HTTP load failed (error code: -1009 [1:50]) 2017-11-28 20:30:59.027530+0300 Startscream_Test[654:767193] Task <7E12AC60-4E4C-4C3A-9BC4-85E753A3F534>.<3> finished with error - code: -1009 2017-11-28 20:30:59.078817+0300 Startscream_Test[654:767193] TIC TCP Conn Failed [13:0x1c4175d80]: 1:50 Err(50) 2017-11-28 20:30:59.094452+0300 Startscream_Test[654:767193] Task <63AAC584-761B-4B16-869B-49C69BF829B5>.<2> HTTP load failed (error code: -1009 [1:50]) 2017-11-28 20:30:59.095649+0300 Startscream_Test[654:767123] Task <63AAC584-761B-4B16-869B-49C69BF829B5>.<2> finished with error - code: -1009 2017-11-28 20:31:01.407031+0300 Startscream_Test[654:768181] TIC TCP Conn Failed [14:0x1c0177340]: 1:50 Err(50) 2017-11-28 20:31:01.425840+0300 Startscream_Test[654:768181] Task <D37627B8-B6F2-491B-96DE-9A736C19CC96>.<3> HTTP load failed (error code: -1009 [1:50]) 2017-11-28 20:31:01.426544+0300 Startscream_Test[654:768181] Task <D37627B8-B6F2-491B-96DE-9A736C19CC96>.<3> finished with error - code: -1009 2017-11-28 20:31:05.483091+0300 Startscream_Test[654:767123] TIC TCP Conn Failed [15:0x1c0177400]: 1:50 Err(50) 2017-11-28 20:31:05.492083+0300 Startscream_Test[654:767123] Task <8641E440-0B8A-4FB3-9D8E-02A9FCB245D6>.<4> HTTP load failed (error code: -1009 [1:50]) 2017-11-28 20:31:05.492788+0300 Startscream_Test[654:767123] Task <8641E440-0B8A-4FB3-9D8E-02A9FCB245D6>.<4> finished with error - code: -1009

Can you tell me about this method and why stream(_:handle:) doesn't call again?

@daltoniam
Copy link
Owner

I'm not exactly sure what you are asking, but the stream(_ aStream: Stream, handle eventCode: Stream.Event) is a foundation delegate callback. It only gets called when the system detects a network update. That call isn't guaranteed to be called on loss of an internet connection (until a timeout). You can read more about this here #401.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants