diff options
author | Bert Belder <bertbelder@gmail.com> | 2012-05-07 23:30:55 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2012-05-09 03:56:19 +0200 |
commit | 0e57aafbb1c4ad9c8157bfe7f5718e867861492e (patch) | |
tree | cc414e73de3c0cadfa8e2cfa54898e9eb0cf4cd2 /src/stream_wrap.h | |
parent | 4ddafbd5633827b4e855472acebf4525c817e011 (diff) | |
download | node-new-0e57aafbb1c4ad9c8157bfe7f5718e867861492e.tar.gz |
Optimize writing strings with Socket.write
Diffstat (limited to 'src/stream_wrap.h')
-rw-r--r-- | src/stream_wrap.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/stream_wrap.h b/src/stream_wrap.h index 278fda7827..40947d5085 100644 --- a/src/stream_wrap.h +++ b/src/stream_wrap.h @@ -35,11 +35,15 @@ class StreamWrap : public HandleWrap { static void Initialize(v8::Handle<v8::Object> target); // JavaScript functions - static v8::Handle<v8::Value> Write(const v8::Arguments& args); static v8::Handle<v8::Value> ReadStart(const v8::Arguments& args); static v8::Handle<v8::Value> ReadStop(const v8::Arguments& args); static v8::Handle<v8::Value> Shutdown(const v8::Arguments& args); + static v8::Handle<v8::Value> WriteBuffer(const v8::Arguments& args); + static v8::Handle<v8::Value> WriteAsciiString(const v8::Arguments& args); + static v8::Handle<v8::Value> WriteUtf8String(const v8::Arguments& args); + static v8::Handle<v8::Value> WriteUcs2String(const v8::Arguments& args); + protected: StreamWrap(v8::Handle<v8::Object> object, uv_stream_t* stream); virtual ~StreamWrap() { } @@ -61,6 +65,9 @@ class StreamWrap : public HandleWrap { static void OnReadCommon(uv_stream_t* handle, ssize_t nread, uv_buf_t buf, uv_handle_type pending); + template <enum WriteEncoding encoding> + static v8::Handle<v8::Value> WriteStringImpl(const v8::Arguments& args); + size_t slab_offset_; uv_stream_t* stream_; }; |