platform/lib/websocket_context.dart

18 lines
498 B
Dart
Raw Normal View History

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);
2016-09-03 12:34:01 +00:00
}