Index: runtime/bin/eventhandler_win.h |
diff --git a/runtime/bin/eventhandler_win.h b/runtime/bin/eventhandler_win.h |
index 7eb664e9391f320b5ad2b31cca26c536b558adde..619a65a4ed53a479972129ff73d0bbd4fdf5d764 100644 |
--- a/runtime/bin/eventhandler_win.h |
+++ b/runtime/bin/eventhandler_win.h |
@@ -275,11 +275,13 @@ class ClientSocket : public SocketHandle { |
public: |
explicit ClientSocket(SOCKET s) |
: SocketHandle(s), |
- next_(NULL) { type_ = kClientSocket; } |
+ next_(NULL), |
+ flags_(0) { type_ = kClientSocket; } |
ClientSocket(SOCKET s, Dart_Port port) |
: SocketHandle(s, port), |
- next_(NULL) { type_ = kClientSocket; } |
+ next_(NULL), |
+ flags_(0) { type_ = kClientSocket; } |
virtual ~ClientSocket() { |
// Don't delete this object until all pending requests have been handled. |
@@ -288,6 +290,13 @@ class ClientSocket : public SocketHandle { |
ASSERT(next_ == NULL); |
}; |
+ void Shutdown(int how); |
+ bool IsClosedRead() { return (flags_ & (1 << kCloseRead)) != 0; } |
+ bool IsClosedWrite() { return (flags_ & (1 << kCloseWrite)) != 0; } |
+ |
+ void MarkClosedRead() { flags_ |= (1 << kCloseRead); } |
+ void MarkClosedWrite() { flags_ |= (1 << kCloseWrite); } |
+ |
// Internal interface used by the event handler. |
virtual bool IssueRead(); |
virtual bool IssueWrite(); |
@@ -300,9 +309,15 @@ class ClientSocket : public SocketHandle { |
void set_next(ClientSocket* next) { next_ = next; } |
private: |
+ enum Flags { |
+ kCloseRead = 0, |
+ kCloseWrite = 1 |
+ }; |
+ |
virtual void AfterClose(); |
ClientSocket* next_; |
+ int flags_; |
}; |