close requests

This commit is contained in:
thosakwe 2016-09-03 08:43:34 -04:00
parent 29a682cce8
commit ab9926e1d2
2 changed files with 6 additions and 4 deletions

View file

@ -126,9 +126,7 @@ class AngelWebSocket {
}
var event = handleAction(action, socket);
if (event is Future)
event = await event;
if (event is Future) event = await event;
if (event is WebSocketEvent) {
batchEvent(event);
@ -169,6 +167,10 @@ class AngelWebSocket {
if (!WebSocketTransformer.isUpgradeRequest(req.underlyingRequest))
throw new AngelHttpException.BadRequest();
res
..willCloseItself = true
..end();
var ws = await WebSocketTransformer.upgrade(req.underlyingRequest);
_clients.add(ws);

View file

@ -1,6 +1,6 @@
name: angel_websocket
description: WebSocket plugin for Angel
version: 1.0.0-dev+2
version: 1.0.0-dev+3
author: thosakwe <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/angel_websocket
dependencies: