Sorry for asking on github, I didn't notice this forum.
I'm having an issue with SignalR js client. The server part is a C# self host service.
Using browsers like firefox/chrome for desktop it all works as expected but in iOS the timeout fires a long time after the specified.
I already tried using a different hostname for the connection to make sure iOS wasn't blocking multiple connections to same host but it didn't make any difference.
I'm not quite following what the issue is here. What do you mean by "the timeout fires"? Can you enable logging in the client ($.connection.hub.logging = true) and paste the result here?
Damian Edwards
Senior Program Manager, ASP.NET
Microsoft
With 'the timeout fires' I mean the timeout event happens.
Here are the logs
[22:05:07 GMT+0000 (WET)] SignalR:Auto detected cross domain url.
[22:05:07 GMT+0000 (WET)] SignalR:Negotiating with 'http://sockets-host.domain:8003/sockets/negotiate'.
[22:05:08 GMT+0000 (WET)] SignalR:SignalR:Initializing long polling connection with server.
[22:05:08 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets/connect?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&sockets&tid=1' using longPolling.
[22:05:08 GMT+0000 (WET)] SignalR:Longpolling connected
[22:05:09 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2C1%7CF%2C0&sockets&tid=4' using longPolling.
[22:05:09 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2C2%7CF%2C0&sockets&tid=3' using longPolling.
[22:05:09 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2C3%7CF%2C0&sockets&tid=9' using longPolling.
[22:05:09 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2C4%7CF%2C0&sockets&tid=8' using longPolling.
[22:05:09 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2C5%7CF%2C0&sockets&tid=1' using longPolling.
[22:05:10 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2C6%7CF%2C0&sockets&tid=10' using longPolling.
[22:05:10 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2C7%7CF%2C0&sockets&tid=8' using longPolling.
[22:05:10 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2C8%7CF%2C0&sockets&tid=9' using longPolling.
[22:05:10 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2C9%7CF%2C0&sockets&tid=1' using longPolling.
[22:05:10 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CA%7CF%2C0&sockets&tid=3' using longPolling.
[22:05:11 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=10' using longPolling.
[22:05:14 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=6' using longPolling.
[22:05:17 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=1' using longPolling.
[22:05:20 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=1' using longPolling.
[22:05:23 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=8' using longPolling.
[22:05:26 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=0' using longPolling.
[22:05:29 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=8' using longPolling.
[22:05:32 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=4' using longPolling.
[22:05:35 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=0' using longPolling.
[22:05:38 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=3' using longPolling.
[22:05:41 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=0' using longPolling.
[22:05:44 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=6' using longPolling.
[22:05:47 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=9' using longPolling.
[22:05:50 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=9' using longPolling.
[22:05:53 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=6' using longPolling.
[22:05:56 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=8' using longPolling.
[22:05:59 GMT+0000 (WET)] SignalR:Attempting to connect to 'http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=2' using longPolling.
[22:06:30 GMT+0000 (WET)] SignalR:An error occurred using longPolling. Status = error.
[22:06:30 GMT+0000 (WET)] SignalR:SignalR:Initializing long polling connection with server.
http://sockets-host.domain:8003/sockets?transport=longPolling&connectionId=55c0b27f-4281-4eb0-8399-b5d2af63e304&messageId=B%2C0%7CE%2CB%7CF%2C0&sockets&tid=2&_=1359065159752Failed to load resource: The request timed out.
[22:06:33 GMT+0000 (WET)] SignalR:Couldn't reconnect within the configured timeout (3000ms),disconnecting.
[22:06:33 GMT+0000 (WET)] SignalR:Auto detected cross domain url.
[22:06:33 GMT+0000 (WET)] SignalR:Negotiating with 'http://sockets-host.domain:8003/sockets/negotiate'.
[22:06:57 GMT+0000 (WET)] SignalR:SignalR:Server ping failed because 'SignalR:Error pinging server:error',re-trying ping.
http://sockets-host.domain:8003/sockets/ping?_=1359065190778Failed to load resource: The request timed out.
At 22.06.00 I killed the SignalR server.
With firefox my configured timeouts on the server are used but with an iPad using latest iOS there is aproximatelly 30 secs before the time out.
I'm not sure this has anything to do with the configured timeout values. Different browsers take different amounts of time to decide that an Ajax request has timed out once the server goes away, which is something beyond our control. In the case of iOS,
it appears that if you have an Ajax long poll request open, and kill the server, it takes 30 seconds before the browser treats it as timed out. The SignalR time out values are used to determine how long the server will wait after a connection has disappeared
before considering it gone. We also have a client-side keep alive check that keeps track of the last time it saw data from the server, but that's not used in long polling.
Damian Edwards
Senior Program Manager, ASP.NET
Microsoft
abel.silva
0 Points
4 Posts
iOS timeouts
Jan 23, 2013 10:57 AM|LINK
Hi
Sorry for asking on github, I didn't notice this forum.
I'm having an issue with SignalR js client. The server part is a C# self host service.
Using browsers like firefox/chrome for desktop it all works as expected but in iOS the timeout fires a long time after the specified.
Sometimes it takes almost 30 secs to fire.
My configuration is:
I already tried using a different hostname for the connection to make sure iOS wasn't blocking multiple connections to same host but it didn't make any difference.
Is there something I'm missing?
Thank you
abel
DamianEdward...
Member
234 Points
37 Posts
Microsoft
Re: iOS timeouts
Jan 23, 2013 06:29 PM|LINK
I'm not quite following what the issue is here. What do you mean by "the timeout fires"? Can you enable logging in the client ($.connection.hub.logging = true) and paste the result here?
Senior Program Manager, ASP.NET
Microsoft
abel.silva
0 Points
4 Posts
Re: iOS timeouts
Jan 24, 2013 09:18 PM|LINK
Hi
With 'the timeout fires' I mean the timeout event happens.
Here are the logs
At 22.06.00 I killed the SignalR server.
With firefox my configured timeouts on the server are used but with an iPad using latest iOS there is aproximatelly 30 secs before the time out.
I mean when
abel.silva
0 Points
4 Posts
Re: iOS timeouts
Jan 24, 2013 09:58 PM|LINK
This is the state of the client after disconnection
DamianEdward...
Member
234 Points
37 Posts
Microsoft
Re: iOS timeouts
Jan 25, 2013 12:47 AM|LINK
I'm not sure this has anything to do with the configured timeout values. Different browsers take different amounts of time to decide that an Ajax request has timed out once the server goes away, which is something beyond our control. In the case of iOS, it appears that if you have an Ajax long poll request open, and kill the server, it takes 30 seconds before the browser treats it as timed out. The SignalR time out values are used to determine how long the server will wait after a connection has disappeared before considering it gone. We also have a client-side keep alive check that keeps track of the last time it saw data from the server, but that's not used in long polling.
Senior Program Manager, ASP.NET
Microsoft
abel.silva
0 Points
4 Posts
Re: iOS timeouts
Jan 25, 2013 11:09 PM|LINK
I was able to what I needed by configuring the xhr timeout
mysocket.start(function () { $.ajaxSetup({'timeout': mysocket.disconnectTimeout + 1000}); });davidfowl
Contributor
2699 Points
611 Posts
Microsoft
Re: iOS timeouts
Jan 28, 2013 04:57 AM|LINK
I have no idea how that fixes anything but if it works for you that's great,
Senior SDE, ASP.NET Team, Microsoft