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

Unified Diff: runtime/bin/socket_impl.dart

Issue 10032027: Add remoteHost to Socket. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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
Index: runtime/bin/socket_impl.dart
diff --git a/runtime/bin/socket_impl.dart b/runtime/bin/socket_impl.dart
index 7cc920c1ca84dd523e93dcded9c0970ba3049b9c..3ca73bf729001b1b473e7a668f88ced3de10e11a 100644
--- a/runtime/bin/socket_impl.dart
+++ b/runtime/bin/socket_impl.dart
@@ -551,12 +551,21 @@ class _Socket extends _SocketBase implements Socket {
int get remotePort() {
if (_remotePort === null) {
- _remotePort = _getRemotePort();
+ remoteHost;
}
return _remotePort;
}
- int _getRemotePort() native "Socket_GetRemotePort";
+ String get remoteHost() {
+ if (_remoteHost === null) {
+ List peer = _getRemotePeer();
+ _remoteHost = peer[0];
+ _remotePort = peer[1];
+ }
+ return _remoteHost;
+ }
+
+ List _getRemotePeer() native "Socket_GetRemotePeer";
static SendPort _newServicePort() native "Socket_NewServicePort";
@@ -572,6 +581,7 @@ class _Socket extends _SocketBase implements Socket {
Function _clientWriteHandler;
SocketInputStream _inputStream;
SocketOutputStream _outputStream;
+ String _remoteHost;
int _remotePort;
static SendPort _socketService;
}

Powered by Google App Engine
This is Rietveld 408576698