| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_EVENTHANDLER_LINUX_H_ | 5 #ifndef BIN_EVENTHANDLER_LINUX_H_ |
| 6 #define BIN_EVENTHANDLER_LINUX_H_ | 6 #define BIN_EVENTHANDLER_LINUX_H_ |
| 7 | 7 |
| 8 #if !defined(BIN_EVENTHANDLER_H_) | 8 #if !defined(BIN_EVENTHANDLER_H_) |
| 9 #error Do not include eventhandler_linux.h directly; use eventhandler.h instead. | 9 #error Do not include eventhandler_linux.h directly; use eventhandler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 shutdown(fd_, SHUT_RD); | 39 shutdown(fd_, SHUT_RD); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void ShutdownWrite() { | 42 void ShutdownWrite() { |
| 43 shutdown(fd_, SHUT_WR); | 43 shutdown(fd_, SHUT_WR); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void Close() { | 46 void Close() { |
| 47 port_ = 0; | 47 port_ = 0; |
| 48 mask_ = 0; | 48 mask_ = 0; |
| 49 close(fd_); | 49 Socket::Close(fd_); |
| 50 fd_ = -1; | 50 fd_ = -1; |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool IsListeningSocket() { return (mask_ & (1 << kListeningSocket)) != 0; } | 53 bool IsListeningSocket() { return (mask_ & (1 << kListeningSocket)) != 0; } |
| 54 bool IsPipe() { return (mask_ & (1 << kPipe)) != 0; } | 54 bool IsPipe() { return (mask_ & (1 << kPipe)) != 0; } |
| 55 | 55 |
| 56 void SetPortAndMask(Dart_Port port, intptr_t mask) { | 56 void SetPortAndMask(Dart_Port port, intptr_t mask) { |
| 57 ASSERT(fd_ != -1); | 57 ASSERT(fd_ != -1); |
| 58 port_ = port; | 58 port_ = port; |
| 59 mask_ = mask; | 59 mask_ = mask; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 bool shutdown_; | 100 bool shutdown_; |
| 101 int interrupt_fds_[2]; | 101 int interrupt_fds_[2]; |
| 102 int epoll_fd_; | 102 int epoll_fd_; |
| 103 int timer_fd_; | 103 int timer_fd_; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace bin | 106 } // namespace bin |
| 107 } // namespace dart | 107 } // namespace dart |
| 108 | 108 |
| 109 #endif // BIN_EVENTHANDLER_LINUX_H_ | 109 #endif // BIN_EVENTHANDLER_LINUX_H_ |
| OLD | NEW |