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

Side by Side Diff: runtime/bin/socket.h

Issue 14619008: Add static getters for common internet addresses (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef BIN_SOCKET_H_ 5 #ifndef BIN_SOCKET_H_
6 #define BIN_SOCKET_H_ 6 #define BIN_SOCKET_H_
7 7
8 #include "bin/builtin.h" 8 #include "bin/builtin.h"
9 #include "bin/utils.h" 9 #include "bin/utils.h"
10 10
(...skipping 24 matching lines...) Expand all
35 }; 35 };
36 36
37 class SocketAddress { 37 class SocketAddress {
38 public: 38 public:
39 enum { 39 enum {
40 TYPE_ANY = -1, 40 TYPE_ANY = -1,
41 TYPE_IPV4, 41 TYPE_IPV4,
42 TYPE_IPV6, 42 TYPE_IPV6,
43 }; 43 };
44 44
45 enum {
46 ADDRESS_LOOPBACK_IP_V4,
47 ADDRESS_LOOPBACK_IP_V6,
48 ADDRESS_ANY_IP_V4,
49 ADDRESS_ANY_IP_V6,
50 ADDRESS_FIRST = ADDRESS_LOOPBACK_IP_V4,
51 ADDRESS_LAST = ADDRESS_ANY_IP_V6,
52 };
53
45 explicit SocketAddress(struct addrinfo* addrinfo); 54 explicit SocketAddress(struct addrinfo* addrinfo);
46 55
47 int GetType() { 56 int GetType() {
48 if (addr_.ss.ss_family == AF_INET6) return TYPE_IPV6; 57 if (addr_.ss.ss_family == AF_INET6) return TYPE_IPV6;
49 return TYPE_IPV4; 58 return TYPE_IPV4;
50 } 59 }
51 60
52 const char* as_string() const { return as_string_; } 61 const char* as_string() const { return as_string_; }
53 const RawAddr& addr() const { return addr_; } 62 const RawAddr& addr() const { return addr_; }
54 63
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 intptr_t backlog); 179 intptr_t backlog);
171 180
172 DISALLOW_ALLOCATION(); 181 DISALLOW_ALLOCATION();
173 DISALLOW_IMPLICIT_CONSTRUCTORS(ServerSocket); 182 DISALLOW_IMPLICIT_CONSTRUCTORS(ServerSocket);
174 }; 183 };
175 184
176 } // namespace bin 185 } // namespace bin
177 } // namespace dart 186 } // namespace dart
178 187
179 #endif // BIN_SOCKET_H_ 188 #endif // BIN_SOCKET_H_
OLDNEW
« no previous file with comments | « runtime/bin/io_natives.cc ('k') | runtime/bin/socket.cc » ('j') | runtime/bin/socket.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698