OLD | NEW |
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 <map> | 8 #include <map> |
9 | 9 |
10 #include "platform/globals.h" | 10 #include "platform/globals.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 public: | 182 public: |
183 explicit InterfaceSocketAddress(struct sockaddr* sa, | 183 explicit InterfaceSocketAddress(struct sockaddr* sa, |
184 const char* interface_name, | 184 const char* interface_name, |
185 intptr_t interface_index) | 185 intptr_t interface_index) |
186 : socket_address_(new SocketAddress(sa)), | 186 : socket_address_(new SocketAddress(sa)), |
187 interface_name_(interface_name), | 187 interface_name_(interface_name), |
188 interface_index_(interface_index) {} | 188 interface_index_(interface_index) {} |
189 | 189 |
190 ~InterfaceSocketAddress() { | 190 ~InterfaceSocketAddress() { |
191 delete socket_address_; | 191 delete socket_address_; |
192 free(const_cast<char*>(interface_name_)); | |
193 } | 192 } |
194 | 193 |
195 SocketAddress* socket_address() const { return socket_address_; } | 194 SocketAddress* socket_address() const { return socket_address_; } |
196 const char* interface_name() const { return interface_name_; } | 195 const char* interface_name() const { return interface_name_; } |
197 int interface_index() const { return interface_index_; } | 196 int interface_index() const { return interface_index_; } |
198 | 197 |
199 private: | 198 private: |
200 SocketAddress* socket_address_; | 199 SocketAddress* socket_address_; |
201 const char* interface_name_; | 200 const char* interface_name_; |
202 intptr_t interface_index_; | 201 intptr_t interface_index_; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 | 414 |
416 private: | 415 private: |
417 DISALLOW_COPY_AND_ASSIGN(ListeningSocketRegistry); | 416 DISALLOW_COPY_AND_ASSIGN(ListeningSocketRegistry); |
418 }; | 417 }; |
419 | 418 |
420 | 419 |
421 } // namespace bin | 420 } // namespace bin |
422 } // namespace dart | 421 } // namespace dart |
423 | 422 |
424 #endif // BIN_SOCKET_H_ | 423 #endif // BIN_SOCKET_H_ |
OLD | NEW |