| Server IP : 146.190.157.162 / Your IP : 216.73.217.6 Web Server : Apache System : Linux ubuntu-s-2vcpu-4gb-amd-sfo3-01-KIT-DIGITAL 6.5.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 15:10:09 UTC 2024 x86_64 User : businessweek ( 639) PHP Version : 8.2.10-2ubuntu2.2 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_signal,pcntl_signal_dispatch,pcntl_getpriority,pcntl_setpriority,dl,putenv,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/include/nodejs/src/ |
Upload File : |
#ifndef SRC_STREAM_PIPE_H_
#define SRC_STREAM_PIPE_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "stream_base.h"
namespace node {
class StreamPipe : public AsyncWrap {
public:
~StreamPipe() override;
void Unpipe(bool is_in_deletion = false);
static v8::Maybe<StreamPipe*> New(StreamBase* source,
StreamBase* sink,
v8::Local<v8::Object> obj);
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Start(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Unpipe(const v8::FunctionCallbackInfo<v8::Value>& args);
static void IsClosed(const v8::FunctionCallbackInfo<v8::Value>& args);
static void PendingWrites(const v8::FunctionCallbackInfo<v8::Value>& args);
SET_NO_MEMORY_INFO()
SET_MEMORY_INFO_NAME(StreamPipe)
SET_SELF_SIZE(StreamPipe)
private:
StreamPipe(StreamBase* source, StreamBase* sink, v8::Local<v8::Object> obj);
inline StreamBase* source();
inline StreamBase* sink();
int pending_writes_ = 0;
bool is_reading_ = false;
bool is_eof_ = false;
bool is_closed_ = true;
bool sink_destroyed_ = false;
bool source_destroyed_ = false;
bool uses_wants_write_ = false;
// Set a default value so that when we’re coming from Start(), we know
// that we don’t want to read just yet.
// This will likely need to be changed when supporting streams without
// `OnStreamWantsWrite()` support.
size_t wanted_data_ = 0;
void ProcessData(size_t nread, std::unique_ptr<v8::BackingStore> bs);
class ReadableListener : public StreamListener {
public:
uv_buf_t OnStreamAlloc(size_t suggested_size) override;
void OnStreamRead(ssize_t nread, const uv_buf_t& buf) override;
void OnStreamDestroy() override;
};
class WritableListener : public StreamListener {
public:
uv_buf_t OnStreamAlloc(size_t suggested_size) override;
void OnStreamRead(ssize_t nread, const uv_buf_t& buf) override;
void OnStreamAfterWrite(WriteWrap* w, int status) override;
void OnStreamAfterShutdown(ShutdownWrap* w, int status) override;
void OnStreamWantsWrite(size_t suggested_size) override;
void OnStreamDestroy() override;
};
ReadableListener readable_listener_;
WritableListener writable_listener_;
};
} // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_STREAM_PIPE_H_