Open lukepighetti opened 5 years ago
I don't understand the architecture of web_socket_channel
. Shouldn't I be specifying the URI and channels within my package to a multi-platform interface and having the user provide only a websocket driver? The way this is architected it looks like the consuming package specifies all endpoints/channels etc.
The top-level cross-platform export WebSocketChannel
handles delegating to the platform-specific implementations. Just call WebSocketChannel.connect(uri, protocols: protocols)
I have not been able to implement a multiplatform websocket with this package. I see no code examples to assist in the process. The only thing I can figure is that we're supposed to create a platform specific socket channel and pass it to WebSocketChannel.
It's basically gone like this so far:
1) Oh hey, I'm going to use
web_socket_channel
it's multiplatform! 2) What is aStreamChannel
? 3) Okay, importpackage:web_socket_channel/io.dart
... 4) Now I need aWebSocket
? 5) Okay, importdart:io
.... 6) Wait,WebSocket
is abstract? Okay, lets implement....48 methods
?!?!?!Please give us some breadcrumbs.