1.1.0-alpha+3
This commit is contained in:
parent
75cdcc8853
commit
d35ebbd0de
3 changed files with 7 additions and 4 deletions
|
@ -25,7 +25,8 @@ main() async {
|
|||
|
||||
var ws = new AngelWebSocket();
|
||||
|
||||
// Apply configuration
|
||||
// This is a plug-in. It hooks all your services,
|
||||
// to automatically broadcast events.
|
||||
await app.configure(ws.configureServer);
|
||||
|
||||
// Listen for requests at `/ws`.
|
||||
|
@ -58,6 +59,9 @@ import "package:angel_websocket/server.dart";
|
|||
|
||||
@Expose("/")
|
||||
class MyController extends WebSocketController {
|
||||
// A reference to the WebSocket plug-in is required.
|
||||
MyController(AngelWebSocket ws):super(ws);
|
||||
|
||||
@override
|
||||
void onConnect(WebSocketContext socket) {
|
||||
// On connect...
|
||||
|
|
|
@ -75,8 +75,7 @@ class WebSockets extends BaseWebSocketClient {
|
|||
return completer.complete(new HtmlWebSocketChannel(socket));
|
||||
})
|
||||
..onError.listen((e) {
|
||||
var err = e as ErrorEvent;
|
||||
if (!completer.isCompleted) return completer.completeError(err.error);
|
||||
if (!completer.isCompleted) return completer.completeError(e is ErrorEvent ? e.error : e);
|
||||
});
|
||||
|
||||
return completer.future;
|
||||
|
|
|
@ -2,7 +2,7 @@ name: angel_websocket
|
|||
description: WebSocket plugin for Angel.
|
||||
environment:
|
||||
sdk: ">=1.19.0"
|
||||
version: 1.1.0-alpha+2
|
||||
version: 1.1.0-alpha+3
|
||||
author: Tobe O <thosakwe@gmail.com>
|
||||
homepage: https://github.com/angel-dart/angel_websocket
|
||||
dependencies:
|
||||
|
|
Loading…
Reference in a new issue