@@ -41,6 +41,8 @@ class Message_base : public object_base
41
41
virtual result_t readAll (obj_ptr<Buffer_base>& retVal, AsyncEvent* ac) = 0;
42
42
virtual result_t write (Buffer_base* data, AsyncEvent* ac) = 0;
43
43
virtual result_t get_length (int64_t & retVal) = 0;
44
+ virtual result_t end () = 0;
45
+ virtual result_t isEnded (bool & retVal) = 0;
44
46
virtual result_t clear () = 0;
45
47
virtual result_t sendTo (Stream_base* stm, AsyncEvent* ac) = 0;
46
48
virtual result_t readFrom (Stream_base* stm, AsyncEvent* ac) = 0;
@@ -67,6 +69,8 @@ class Message_base : public object_base
67
69
static void s_readAll (const v8::FunctionCallbackInfo<v8::Value>& args);
68
70
static void s_write (const v8::FunctionCallbackInfo<v8::Value>& args);
69
71
static void s_get_length (v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value> &args);
72
+ static void s_end (const v8::FunctionCallbackInfo<v8::Value>& args);
73
+ static void s_isEnded (const v8::FunctionCallbackInfo<v8::Value>& args);
70
74
static void s_clear (const v8::FunctionCallbackInfo<v8::Value>& args);
71
75
static void s_sendTo (const v8::FunctionCallbackInfo<v8::Value>& args);
72
76
static void s_readFrom (const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -99,6 +103,8 @@ namespace fibjs
99
103
{" read" , s_read, false },
100
104
{" readAll" , s_readAll, false },
101
105
{" write" , s_write, false },
106
+ {" end" , s_end, false },
107
+ {" isEnded" , s_isEnded, false },
102
108
{" clear" , s_clear, false },
103
109
{" sendTo" , s_sendTo, false },
104
110
{" readFrom" , s_readFrom, false }
@@ -306,6 +312,32 @@ namespace fibjs
306
312
METHOD_RETURN ();
307
313
}
308
314
315
+ inline void Message_base::s_end (const v8::FunctionCallbackInfo<v8::Value>& args)
316
+ {
317
+ METHOD_INSTANCE (Message_base);
318
+ METHOD_ENTER ();
319
+
320
+ METHOD_OVER (0 , 0 );
321
+
322
+ hr = pInst->end ();
323
+
324
+ METHOD_VOID ();
325
+ }
326
+
327
+ inline void Message_base::s_isEnded (const v8::FunctionCallbackInfo<v8::Value>& args)
328
+ {
329
+ bool vr;
330
+
331
+ METHOD_INSTANCE (Message_base);
332
+ METHOD_ENTER ();
333
+
334
+ METHOD_OVER (0 , 0 );
335
+
336
+ hr = pInst->isEnded (vr);
337
+
338
+ METHOD_RETURN ();
339
+ }
340
+
309
341
inline void Message_base::s_clear (const v8::FunctionCallbackInfo<v8::Value>& args)
310
342
{
311
343
METHOD_INSTANCE (Message_base);
0 commit comments