platform/lib/websocket_context.dart
2016-09-03 08:34:01 -04:00

17 lines
498 B
Dart

part of angel_websocket.server;
class WebSocketContext {
WebSocket underlyingSocket;
RequestContext requestContext;
ResponseContext responseContext;
WebSocketContext(WebSocket this.underlyingSocket,
RequestContext this.requestContext, ResponseContext this.responseContext);
send(String eventName, data) {
underlyingSocket.add(
god.serialize(new WebSocketEvent(eventName: eventName, data: data)));
}
sendError(AngelHttpException error) => send("error", error);
}