Index: runtime/bin/service_object_patch.dart |
diff --git a/runtime/bin/service_object_patch.dart b/runtime/bin/service_object_patch.dart |
index d0056dffb360af9748a619cf95e7789af1cb95ff..fadae3718604500bde0f9aed15569d753a6d90a3 100644 |
--- a/runtime/bin/service_object_patch.dart |
+++ b/runtime/bin/service_object_patch.dart |
@@ -8,6 +8,7 @@ final Map _servicePathMap = { |
'servers' : _httpServersServiceObject, |
}, |
'sockets' : _socketsServiceObject, |
+ 'websockets' : _webSocketsServiceObject, |
'file' : { |
'randomaccessfiles' : _randomAccessFilesServiceObject |
}, |
@@ -81,6 +82,22 @@ Map _socketsServiceObject(args) { |
}; |
} |
+Map _webSocketsServiceObject(args) { |
+ if (args.length == 1) { |
+ var webSocket = _WebSocketImpl._webSockets[int.parse(args.first)]; |
+ if (webSocket == null) { |
+ return {}; |
+ } |
+ return webSocket._toJSON(false); |
+ } |
+ return { |
+ 'id': 'io/websockets', |
+ 'type': 'WebSocketList', |
+ 'members': _WebSocketImpl._webSockets.values |
+ .map((webSocket) => webSocket._toJSON(true)).toList(), |
+ }; |
+} |
+ |
Map _randomAccessFilesServiceObject(args) { |
if (args.length == 1) { |
var raf = _RandomAccessFile._files[int.parse(args.first)]; |