Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Unified Diff: runtime/bin/socket.cc

Issue 9963053: Add remotePort getter to Socket. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/socket.h ('k') | runtime/bin/socket.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket.cc
===================================================================
--- runtime/bin/socket.cc (revision 6086)
+++ runtime/bin/socket.cc (working copy)
@@ -153,6 +153,22 @@
}
+void FUNCTION_NAME(Socket_GetRemotePort)(Dart_NativeArguments args) {
+ Dart_EnterScope();
+ intptr_t socket =
+ DartUtils::GetIntegerField(Dart_GetNativeArgument(args, 0),
+ DartUtils::kIdFieldName);
+ OSError os_error;
+ intptr_t port = Socket::GetRemotePort(socket);
+ if (port > 0) {
+ Dart_SetReturnValue(args, Dart_NewInteger(port));
+ } else {
+ Dart_SetReturnValue(args, DartUtils::NewDartOSError());
+ }
+ Dart_ExitScope();
+}
+
+
void FUNCTION_NAME(Socket_GetError)(Dart_NativeArguments args) {
Dart_EnterScope();
intptr_t socket =
« no previous file with comments | « runtime/bin/socket.h ('k') | runtime/bin/socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698