Skip to content

Commit

Permalink
Add a reference to AdapterWebSocketChannel for WebSocketChannel users (
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan authored Aug 28, 2024
1 parent 7f21111 commit bbfce40
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pkgs/cupertino_http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 1.5.2-wip

## 1.5.1

* Allow `1000` as a `code` argument in `CupertinoWebSocket.close`.
Expand Down
10 changes: 8 additions & 2 deletions pkgs/cupertino_http/lib/src/cupertino_web_socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ class ConnectionException extends WebSocketException {
/// A [WebSocket] implemented using the
/// [NSURLSessionWebSocketTask API](https://developer.apple.com/documentation/foundation/nsurlsessionwebsockettask).
///
/// NOTE: the [WebSocket] interface is currently experimental and may change in
/// the future.
/// > [!NOTE]
/// > The [WebSocket] interface is currently experimental and may change in the
/// > future.
///
/// ```dart
/// import 'package:cupertino_http/cupertino_http.dart';
Expand All @@ -47,6 +48,11 @@ class ConnectionException extends WebSocketException {
/// });
/// }
/// ```
///
/// > [!TIP]
/// > [`AdapterWebSocketChannel`](https://pub.dev/documentation/web_socket_channel/latest/adapter_web_socket_channel/AdapterWebSocketChannel-class.html)
/// > can be used to adapt a [CupertinoWebSocket] into a
/// > [`WebSocketChannel`](https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel/WebSocketChannel-class.html).
class CupertinoWebSocket implements WebSocket {
/// Create a new WebSocket connection using the
/// [NSURLSessionWebSocketTask API](https://developer.apple.com/documentation/foundation/nsurlsessionwebsockettask).
Expand Down
2 changes: 1 addition & 1 deletion pkgs/cupertino_http/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cupertino_http
version: 1.5.1
version: 1.5.2-wip
description: >-
A macOS/iOS Flutter plugin that provides access to the Foundation URL
Loading System.
Expand Down
9 changes: 9 additions & 0 deletions pkgs/ok_http/lib/src/ok_http_web_socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import 'jni/bindings.dart' as bindings;
/// [WebSocket](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html)
/// API.
///
/// > [!NOTE]
/// > The [WebSocket] interface is currently experimental and may change in the
/// > future.
///
/// Example usage of [OkHttpWebSocket]:
/// ```dart
/// import 'package:ok_http/ok_http.dart';
Expand All @@ -37,6 +41,11 @@ import 'jni/bindings.dart' as bindings;
/// });
/// }
/// ```
///
/// > [!TIP]
/// > [`AdapterWebSocketChannel`](https://pub.dev/documentation/web_socket_channel/latest/adapter_web_socket_channel/AdapterWebSocketChannel-class.html)
/// > can be used to adapt a [OkHttpWebSocket] into a
/// > [`WebSocketChannel`](https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel/WebSocketChannel-class.html).
class OkHttpWebSocket implements WebSocket {
late bindings.OkHttpClient _client;
late final bindings.WebSocket _webSocket;
Expand Down

0 comments on commit bbfce40

Please sign in to comment.