Skip to content

Please, clarify WebSocket description #30795

Open
@alsemenov

Description

Current description for class dart:io:WebSocket is quite short.
Please, specify the following:

  • The WebSockets specification and version (probably some draft) which is implemented by dart:io:WebSocket class. This is important for heterogeneous communications. The other side (which might be not Dart) should know what expect.
  • Which protocols and extensions are supported?
  • Whether messages (especially List<int>) are transfered without splitting or joining with another messages
  • The WebSocket life cycle, like readyState (?) is CONNECTING after call to connect, OPEN after future returned by connect completes, etc. (BTW CONNECTING seems to be redundant in this case).
  • How the readyState of paired instance is affected, when WebSocket is closed or closing
  • If done event is received on WebSocket (which implements Stream) is it necessary to close the WebSocket explicitly?
  • Will peer instance receive done event after call to close?
  • WebSocket implements StreamSink, however only String and List<int> are allowed as events, which formally violates contract of StreamSink. What will happen if events other than String and List<int> are supplied to method add? Why it is not possible to send events of some simple types like int, bool, Map, etc?

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions