Index: runtime/bin/service_object_patch.dart |
diff --git a/runtime/bin/service_object_patch.dart b/runtime/bin/service_object_patch.dart |
index 2a0669419a4a9c5260015cf3f9b701278f3821d7..a7e104e61a0eafb8484a8b372295891dfac4b52f 100644 |
--- a/runtime/bin/service_object_patch.dart |
+++ b/runtime/bin/service_object_patch.dart |
@@ -5,8 +5,9 @@ |
final Map _servicePathMap = { |
'http' : { |
- 'servers' : _httpServersServiceObject |
+ 'servers' : _httpServersServiceObject, |
}, |
+ 'socket' : _socketServiceObject, |
'file' : { |
'randomaccessfiles' : _randomAccessFilesServiceObject |
} |
@@ -63,6 +64,22 @@ Map _httpServersServiceObject(args) { |
}; |
} |
+Map _socketServiceObject(args) { |
+ if (args.length == 1) { |
+ var socket = _NativeSocket._sockets[int.parse(args.first)]; |
+ if (socket == null) { |
+ return {}; |
+ } |
+ return socket._toJSON(false); |
+ } |
+ return { |
+ 'id': 'io/socket', |
+ 'type': 'SocketList', |
+ 'members': _NativeSocket._sockets.values |
+ .map((socket) => socket._toJSON(true)).toList(), |
+ }; |
+} |
+ |
Map _randomAccessFilesServiceObject(args) { |
if (args.length == 1) { |
var raf = _RandomAccessFile._files[int.parse(args.first)]; |