ForceUniverse / dart-force

Dart Realtime Web Framework!
https://pub.dartlang.org/packages/force
Other
89 stars 9 forks source link

Long polling should be an automatic fallback #5

Closed delaneyj closed 10 years ago

delaneyj commented 10 years ago

If the browser doesn't support WebSocket then use long polling as a last resort and setup automatically.

jorishermans commented 10 years ago

It is already in the code!

factory Socket(String url, {bool usePolling: false, int heartbeat: 2000}) { print("choose a socket implementation!"); if (usePolling || !WebSocket.supported) { return new PollingSocket(url, heartbeat); } else { return new WebSocketWrapper(url); } }

See Websocket.supported for this! So I check already the usage for that, you can only set this too by the optional parameter!

jorishermans commented 10 years ago

Please reopen it when the fallback is not working in a browser. Or give me a pull request with a fix in it ;-)

delaneyj commented 10 years ago

Ah, I was picking up the "Choose a socket implementation" which should probably be "Choosing an socket implementation: X found" or something.