Page MenuHomePhabricator

Implement JX.WebSocket
ClosedPublic

Authored by epriestley on Jan 6 2015, 3:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 24, 7:03 AM
Unknown Object (File)
Sat, Mar 16, 5:58 PM
Unknown Object (File)
Sat, Mar 16, 5:16 PM
Unknown Object (File)
Sun, Mar 10, 2:47 PM
Unknown Object (File)
Sun, Mar 10, 12:22 PM
Unknown Object (File)
Sun, Mar 10, 11:36 AM
Unknown Object (File)
Sun, Mar 10, 10:36 AM
Unknown Object (File)
Sun, Mar 10, 8:05 AM
Subscribers

Details

Summary

Ref T6559. Wraps WebSocket in a reasonable driver class which does event dispatch, some state management, and handles automatic reconnect.

Test Plan

In Safari, Firefox and Chrome, connected to a websocket server and sent messages back and forth. Terminated and restarted server, saw automatic reconnects successfully reestablish a connection on all browsers.

Diff Detail

Repository
rP Phabricator
Branch
websockets
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3642
Build 3651: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to [Draft] JX.WebSocket.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley retitled this revision from [Draft] JX.WebSocket to Implement JX.WebSocket.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: btrahan, joshuaspence.
  • Add some comments; reasonable basic implementation.
joshuaspence edited edge metadata.
joshuaspence added inline comments.
webroot/rsrc/externals/javelin/lib/Websocket.js
17

Maybe lowercase?

68–70

I feel that maybe this should happen at another layer... if you have asked for JX.WebSocket but your browser doesn't support WebSockets then we should probably throw an exception.

This revision is now accepted and ready to land.Jan 6 2015, 8:47 PM
epriestley edited edge metadata.
  • Rename to WebSocket for consistency.
  • Port connect delay fix from D11143 back here.
  • I'm keeping the semantics since they're slightly more natural for our use case. The send() semantics (where it just swallows messages when disconnected) are a little weird too, but make implementing the notification stuff easier. We could adjust this stuff later if we do something else with websockets.
This revision was automatically updated to reflect the committed changes.