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 RUNTIME_BIN_EVENTHANDLER_WIN_H_ | 5 #ifndef RUNTIME_BIN_EVENTHANDLER_WIN_H_ |
6 #define RUNTIME_BIN_EVENTHANDLER_WIN_H_ | 6 #define RUNTIME_BIN_EVENTHANDLER_WIN_H_ |
7 | 7 |
8 #if !defined(RUNTIME_BIN_EVENTHANDLER_H_) | 8 #if !defined(RUNTIME_BIN_EVENTHANDLER_H_) |
9 #error Do not include eventhandler_win.h directly; use eventhandler.h instead. | 9 #error Do not include eventhandler_win.h directly; use eventhandler.h instead. |
10 #endif | 10 #endif |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
439 // this queue and processed by dart isolates. | 439 // this queue and processed by dart isolates. |
440 int accepted_count_; | 440 int accepted_count_; |
441 | 441 |
442 DISALLOW_COPY_AND_ASSIGN(ListenSocket); | 442 DISALLOW_COPY_AND_ASSIGN(ListenSocket); |
443 }; | 443 }; |
444 | 444 |
445 | 445 |
446 // Information on connected sockets. | 446 // Information on connected sockets. |
447 class ClientSocket : public DescriptorInfoSingleMixin<SocketHandle> { | 447 class ClientSocket : public DescriptorInfoSingleMixin<SocketHandle> { |
448 public: | 448 public: |
449 explicit ClientSocket(intptr_t s) | 449 explicit ClientSocket(intptr_t s, bool sync = false) |
zra
2017/04/07 05:29:27
The synchronous socket implementation should be co
zra
2017/04/07 14:41:12
After thinking about this some more, I think we sh
bkonyi
2017/04/10 19:20:04
Sounds good. Removed.
| |
450 : DescriptorInfoSingleMixin(s, true), | 450 : DescriptorInfoSingleMixin(s, true), |
451 DisconnectEx_(NULL), | 451 DisconnectEx_(NULL), |
452 next_(NULL), | 452 next_(NULL), |
453 connected_(false), | 453 connected_(false), |
454 closed_(false) { | 454 closed_(false), |
455 sync_(sync), | |
456 { | |
455 LoadDisconnectEx(); | 457 LoadDisconnectEx(); |
456 type_ = kClientSocket; | 458 type_ = kClientSocket; |
457 } | 459 } |
458 | 460 |
459 virtual ~ClientSocket() { | 461 virtual ~ClientSocket() { |
460 // Don't delete this object until all pending requests have been handled. | 462 // Don't delete this object until all pending requests have been handled. |
461 ASSERT(!HasPendingRead()); | 463 ASSERT(!HasPendingRead()); |
462 ASSERT(!HasPendingWrite()); | 464 ASSERT(!HasPendingWrite()); |
463 ASSERT(next_ == NULL); | 465 ASSERT(next_ == NULL); |
464 ASSERT(closed_ == true); | 466 ASSERT(closed_ == true); |
(...skipping 25 matching lines...) Expand all Loading... | |
490 static intptr_t disconnecting() { return disconnecting_; } | 492 static intptr_t disconnecting() { return disconnecting_; } |
491 #endif | 493 #endif |
492 | 494 |
493 private: | 495 private: |
494 bool LoadDisconnectEx(); | 496 bool LoadDisconnectEx(); |
495 | 497 |
496 LPFN_DISCONNECTEX DisconnectEx_; | 498 LPFN_DISCONNECTEX DisconnectEx_; |
497 ClientSocket* next_; | 499 ClientSocket* next_; |
498 bool connected_; | 500 bool connected_; |
499 bool closed_; | 501 bool closed_; |
502 bool sync_; | |
500 | 503 |
501 #if defined(DEBUG) | 504 #if defined(DEBUG) |
502 static intptr_t disconnecting_; | 505 static intptr_t disconnecting_; |
503 #endif | 506 #endif |
504 | 507 |
505 DISALLOW_COPY_AND_ASSIGN(ClientSocket); | 508 DISALLOW_COPY_AND_ASSIGN(ClientSocket); |
506 }; | 509 }; |
507 | 510 |
508 | 511 |
509 class DatagramSocket : public DescriptorInfoSingleMixin<SocketHandle> { | 512 class DatagramSocket : public DescriptorInfoSingleMixin<SocketHandle> { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
575 bool shutdown_; | 578 bool shutdown_; |
576 HANDLE completion_port_; | 579 HANDLE completion_port_; |
577 | 580 |
578 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); | 581 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); |
579 }; | 582 }; |
580 | 583 |
581 } // namespace bin | 584 } // namespace bin |
582 } // namespace dart | 585 } // namespace dart |
583 | 586 |
584 #endif // RUNTIME_BIN_EVENTHANDLER_WIN_H_ | 587 #endif // RUNTIME_BIN_EVENTHANDLER_WIN_H_ |
OLD | NEW |