diff options
Diffstat (limited to 'src/stream_wrap.h')
-rw-r--r-- | src/stream_wrap.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/stream_wrap.h b/src/stream_wrap.h index a97e8ba10f..7847ebe754 100644 --- a/src/stream_wrap.h +++ b/src/stream_wrap.h @@ -88,6 +88,14 @@ class LibuvStreamWrap : public HandleWrap, public StreamBase { v8::Local<v8::FunctionTemplate> target, int flags = StreamBase::kFlagNone); + protected: + inline void set_fd(int fd) { +#ifdef _WIN32 + fd_ = fd; +#endif + } + + private: static void GetWriteQueueSize( const v8::FunctionCallbackInfo<v8::Value>& info); @@ -101,6 +109,16 @@ class LibuvStreamWrap : public HandleWrap, public StreamBase { static void AfterUvShutdown(uv_shutdown_t* req, int status); uv_stream_t* const stream_; + +#ifdef _WIN32 + // We don't always have an FD that we could look up on the stream_ + // object itself on Windows. However, for some cases, we open handles + // using FDs; In that case, we can store and provide the value. + // This became necessary because it allows to detect situations + // where multiple handles refer to the same stdio FDs (in particular, + // a possible IPC channel and a regular process.std??? stream). + int fd_ = -1; +#endif }; |