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

Unified Diff: runtime/bin/socket_win.cc

Issue 76383002: Update InternetAddress (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review commetns Created 7 years, 1 month 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_patch.dart ('k') | sdk/lib/io/socket.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_win.cc
diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc
index 32b690d45cf22e6aa9bba41e063489631b24d508..d8cd9f9589e7fcb88fa7013b2f4adf5ce68066a5 100644
--- a/runtime/bin/socket_win.cc
+++ b/runtime/bin/socket_win.cc
@@ -268,6 +268,20 @@ bool Socket::ReverseLookup(RawAddr addr,
}
+bool Socket::ParseAddress(int type, const char* address, RawAddr* addr) {
+ int result;
+ const wchar_t* system_address = StringUtils::Utf8ToWide(address);
+ if (type == SocketAddress::TYPE_IPV4) {
+ result = InetPton(AF_INET, system_address, &addr->in.sin_addr);
+ } else {
+ ASSERT(type == SocketAddress::TYPE_IPV6);
+ result = InetPton(AF_INET6, system_address, &addr->in6.sin6_addr);
+ }
+ free(const_cast<wchar_t*>(system_address));
+ return result == 1;
+}
+
+
AddressList<InterfaceSocketAddress>* Socket::ListInterfaces(
int type,
OSError** os_error) {
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | sdk/lib/io/socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698