| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_WIN_H_ | 5 #ifndef BIN_EVENTHANDLER_WIN_H_ |
| 6 #define BIN_EVENTHANDLER_WIN_H_ | 6 #define BIN_EVENTHANDLER_WIN_H_ |
| 7 | 7 |
| 8 #include <winsock2.h> | 8 #include <winsock2.h> |
| 9 #include <mswsock.h> | 9 #include <mswsock.h> |
| 10 | 10 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 port_ = port; | 178 port_ = port; |
| 179 mask_ = mask; | 179 mask_ = mask; |
| 180 } | 180 } |
| 181 Type type() { return type_; } | 181 Type type() { return type_; } |
| 182 bool is_file() { return type_ == kFile; } | 182 bool is_file() { return type_ == kFile; } |
| 183 bool is_socket() { return type_ == kListenSocket || type_ == kClientSocket; } | 183 bool is_socket() { return type_ == kListenSocket || type_ == kClientSocket; } |
| 184 bool is_listen_socket() { return type_ == kListenSocket; } | 184 bool is_listen_socket() { return type_ == kListenSocket; } |
| 185 bool is_client_socket() { return type_ == kClientSocket; } | 185 bool is_client_socket() { return type_ == kClientSocket; } |
| 186 intptr_t mask() { return mask_; } | 186 intptr_t mask() { return mask_; } |
| 187 | 187 |
| 188 void MarkDoesNotSupportOverlappedIO() { |
| 189 flags_ |= (1 << kDoesNotSupportOverlappedIO); |
| 190 } |
| 191 bool SupportsOverlappedIO() { |
| 192 return (flags_ & (1 << kDoesNotSupportOverlappedIO)) == 0; |
| 193 } |
| 194 |
| 195 void ReadSyncCompleteAsync(); |
| 196 |
| 188 protected: | 197 protected: |
| 189 enum Flags { | 198 enum Flags { |
| 190 kClosing = 0, | 199 kClosing = 0, |
| 191 kCloseRead = 1, | 200 kCloseRead = 1, |
| 192 kCloseWrite = 2 | 201 kCloseWrite = 2, |
| 202 kDoesNotSupportOverlappedIO = 3 |
| 193 }; | 203 }; |
| 194 | 204 |
| 195 explicit Handle(HANDLE handle); | 205 explicit Handle(HANDLE handle); |
| 196 Handle(HANDLE handle, Dart_Port port); | 206 Handle(HANDLE handle, Dart_Port port); |
| 197 | 207 |
| 198 virtual void AfterClose() = 0; | 208 virtual void AfterClose() = 0; |
| 199 | 209 |
| 200 Type type_; | 210 Type type_; |
| 201 HANDLE handle_; | 211 HANDLE handle_; |
| 202 Dart_Port port_; // Dart port to communicate events for this socket. | 212 Dart_Port port_; // Dart port to communicate events for this socket. |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 private: | 355 private: |
| 346 ClientSocket* client_sockets_head_; | 356 ClientSocket* client_sockets_head_; |
| 347 | 357 |
| 348 int64_t timeout_; // Time for next timeout. | 358 int64_t timeout_; // Time for next timeout. |
| 349 Dart_Port timeout_port_; | 359 Dart_Port timeout_port_; |
| 350 HANDLE completion_port_; | 360 HANDLE completion_port_; |
| 351 }; | 361 }; |
| 352 | 362 |
| 353 | 363 |
| 354 #endif // BIN_EVENTHANDLER_WIN_H_ | 364 #endif // BIN_EVENTHANDLER_WIN_H_ |
| OLD | NEW |