Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention ready in the docs for connect #287

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
## 2.4.1
## 2.4.1-wip

- Update the examples to use `WebSocketChannel.ready` and clarify that
`WebSocketChannel.ready` should be awaited before sending data over the
`WebSocketChannel`.
- Mention `ready` in the docs for `connect`.

## 2.4.0

Expand Down
6 changes: 6 additions & 0 deletions lib/src/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ class WebSocketChannel extends StreamChannelMixin {
/// communicate over the resulting socket.
///
/// The optional [protocols] parameter is the same as `WebSocket.connect`.
///
/// A WebSocketChannel is returned synchronously, however the connection is
/// not established synchronously.
/// The [ready] future will complete after the channel is connected.
/// If there are errors creating the connection the [ready] future will
/// complete with an error.
factory WebSocketChannel.connect(Uri uri, {Iterable<String>? protocols}) =>
platform.connect(uri, protocols: protocols);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: web_socket_channel
version: 2.4.1
version: 2.4.1-wip

description: >-
StreamChannel wrappers for WebSockets. Provides a cross-platform
Expand Down