Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

xhr-polling/(null)?disconnect under edge networking condition #196

Open
dqj opened this issue Jun 26, 2014 · 5 comments
Open

xhr-polling/(null)?disconnect under edge networking condition #196

dqj opened this issue Jun 26, 2014 · 5 comments
Assignees
Milestone

Comments

@dqj
Copy link

dqj commented Jun 26, 2014

My application use this library to connect the socket.io server under edge or gprs carrier, the app will hang over a long time and the error log in the console is:

2014-06-26 19:42:23.564 SocketIOTest[7801:60b] Connecting to socket with URL: localhost:3000/socket.io/1/
2014-06-26 19:42:23.564 SocketIOTest[7801:60b] <SocketIO: 0x170110ce0>
2014-06-26 19:42:33.614 SocketIOTest[7801:60b] ERROR: handshake failed ... The request timed out.
2014-06-26 19:42:33.615 SocketIOTest[7801:60b] Force disconnect at: localhost:3000/socket.io/1/xhr-polling/(null)?disconnect
2014-06-26 19:43:34.525 SocketIOTest[7801:60b] Error during disconnect: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x1780f7c00 {NSUnderlyingError=0x1702455e0 "The request timed out.", NSErrorFailingURLStringKey= localhost:3000/socket.io/1/xhr-polling/(null)?disconnect, NSErrorFailingURLKey= localhost:3000/socket.io/1/xhr-polling/(null)?disconnect, NSLocalizedDescription=The request timed out.}
2014-06-26 19:43:34.526 SocketIOTest[7801:60b] onDisconnect()
2014-06-26 19:43:34.537 SocketIOTest[7801:60b] onError() Error Domain=SocketIOError Code=-6 "The operation couldn’t be completed. (SocketIOError error -6.)" UserInfo=0x170462d80 {NSUnderlyingError=0x1700522d0 "The request timed out."}
@pkyeck
Copy link
Owner

pkyeck commented Jun 26, 2014

the handshake fails ... and after that the library has no URL for a forced disconnect - thus using NULL. try fixing the handshake first - after that the rest should work as expected.

@dqj
Copy link
Author

dqj commented Jun 26, 2014

You are right. The handshake fails. And I think the reason is the network condition is not good, as i change the carrier from the 3G to GPRS/ EDGE. After I change the carrier to 3G, the app runs well.

@dqj
Copy link
Author

dqj commented Jun 27, 2014

Since my app can not shake hand with the server, the app can not send a forced disconnect request to server. While the reason the handshake fails is my app can not connect to server under 2G or 2.5G network. Right?

@pkyeck
Copy link
Owner

pkyeck commented Jun 27, 2014

maybe it is a timeout thing? maybe your phone takes too long to "shake hands" with the server and the call is aborted. never ran into this problem myself.

you could try and connect via

- (void) connectToHost:(NSString *)host onPort:(NSInteger)port withParams:(NSDictionary *)params withNamespace:(NSString *)endpoint withConnectionTimeout: (NSTimeInterval) connectionTimeout;

and set the connectionTimeout to something bigger then 15 seconds.

@dqj
Copy link
Author

dqj commented Jun 27, 2014

I've set the default connectionTimeout to 30s. But the "shake hands" also fails. Have you ever test the library under these type of carrier network, such as GPRS or EDGE?

Thanks!

@pkyeck pkyeck added this to the 0.6 milestone Jul 14, 2014
@pkyeck pkyeck self-assigned this Jul 14, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants