| Index: runtime/bin/socket.cc
|
| diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc
|
| index 2013e093efa492699775419ceeeebb0b26b7318d..1285f1363a17353ac579cf555048d2cefd2c5e12 100644
|
| --- a/runtime/bin/socket.cc
|
| +++ b/runtime/bin/socket.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| @@ -267,6 +267,22 @@ void FUNCTION_NAME(Socket_GetError)(Dart_NativeArguments args) {
|
| }
|
|
|
|
|
| +void FUNCTION_NAME(Socket_GetType)(Dart_NativeArguments args) {
|
| + Dart_EnterScope();
|
| + Dart_Handle socket_obj = Dart_GetNativeArgument(args, 0);
|
| + intptr_t socket = 0;
|
| + Socket::GetSocketIdNativeField(socket_obj, &socket);
|
| + OSError os_error;
|
| + intptr_t type = Socket::GetType(socket);
|
| + if (type >= 0) {
|
| + Dart_SetReturnValue(args, Dart_NewInteger(type));
|
| + } else {
|
| + Dart_SetReturnValue(args, DartUtils::NewDartOSError());
|
| + }
|
| + Dart_ExitScope();
|
| +}
|
| +
|
| +
|
| void FUNCTION_NAME(Socket_GetStdioHandle)(Dart_NativeArguments args) {
|
| Dart_EnterScope();
|
| Dart_Handle socket_obj = Dart_GetNativeArgument(args, 0);
|
|
|