From 39b62afce9ef451f14b201dcbd26a92d02e3bd8c Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 14 Oct 2017 17:36:46 +0000 Subject: [PATCH] Core: WebSocket - socket handle and wait events access git-svn-id: svn://ultimatepp.org/upp/trunk@11380 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/Inet.h | 5 +- uppsrc/Core/Parser.h | 34 ++++++------- uppsrc/Core/heap.cpp | 14 +++--- uppsrc/Core/parser.cpp | 34 ++++++------- uppsrc/Core/src.tpp/CParser$en-us.tpp | 67 +++++++++++-------------- uppsrc/Core/src.tpp/WebSocket$en-us.tpp | 13 +++++ 6 files changed, 86 insertions(+), 81 deletions(-) diff --git a/uppsrc/Core/Inet.h b/uppsrc/Core/Inet.h index 3d82983a4..cde01971d 100644 --- a/uppsrc/Core/Inet.h +++ b/uppsrc/Core/Inet.h @@ -700,8 +700,11 @@ public: void Close(const String& msg = Null); bool IsOpen() const { return socket->IsOpen(); } bool IsClosed() const { return !IsOpen(); } + + dword GetWaitEvents() const { return WAIT_READ|(!!out_queue.GetCount() * WAIT_WRITE); } + SOCKET GetSOCKET() const { return socket ? socket->GetSOCKET() : 0; } - void AddTo(SocketWaitEvent& e) { e.Add(*socket, WAIT_READ|(!!out_queue.GetCount() * WAIT_WRITE)); } + void AddTo(SocketWaitEvent& e) { e.Add(*socket, GetWaitEvents()); } static void Trace(bool b = true); diff --git a/uppsrc/Core/Parser.h b/uppsrc/Core/Parser.h index e508a218f..5a1187d44 100644 --- a/uppsrc/Core/Parser.h +++ b/uppsrc/Core/Parser.h @@ -41,33 +41,33 @@ public: bool Char(char c); bool Char2(char c1, char c2); bool Char3(char c1, char c2, char c3); - void PassChar(char c) throw(Error); - void PassChar2(char c1, char c2) throw(Error); - void PassChar3(char c1, char c2, char c3) throw(Error); + void PassChar(char c); + void PassChar2(char c1, char c2); + void PassChar3(char c1, char c2, char c3); bool Id(const char *s) { return term[0] == s[0] && (s[1] == 0 || term[1] == s[1]) && Id0(s); } - void PassId(const char *s) throw(Error); + void PassId(const char *s); bool IsId() const { return iscib(*term); } bool IsId(const char *s) const { return term[0] == s[0] && (s[1] == 0 || term[1] == s[1]) && IsId0(s); } - String ReadId() throw(Error); - String ReadIdt() throw(Error); + String ReadId(); + String ReadIdt(); bool IsInt() const; int Sgn(); - int ReadInt() throw(Error); - int ReadInt(int min, int max) throw(Error); - int64 ReadInt64() throw(Error); - int64 ReadInt64(int64 min, int64 max) throw(Error); + int ReadInt(); + int ReadInt(int min, int max); + int64 ReadInt64(); + int64 ReadInt64(int64 min, int64 max); bool IsNumber() const { return IsDigit(*term); } bool IsNumber(int base) const; - uint32 ReadNumber(int base = 10) throw(Error); - uint64 ReadNumber64(int base = 10) throw(Error); + uint32 ReadNumber(int base = 10); + uint64 ReadNumber64(int base = 10); bool IsDouble() const { return IsInt(); } bool IsDouble2() const { return IsInt() || IsChar('.'); } - double ReadDouble() throw(Error); + double ReadDouble(); bool IsString() const { return IsChar('\"'); }; - String ReadOneString(bool chkend = true) throw(Error); - String ReadString(bool chkend = true) throw(Error); - String ReadOneString(int delim, bool chkend = true) throw(Error); - String ReadString(int delim, bool chkend = true) throw(Error); + String ReadOneString(bool chkend = true); + String ReadString(bool chkend = true); + String ReadOneString(int delim, bool chkend = true); + String ReadString(int delim, bool chkend = true); void SkipTerm(); diff --git a/uppsrc/Core/heap.cpp b/uppsrc/Core/heap.cpp index e40eec978..952fe8153 100644 --- a/uppsrc/Core/heap.cpp +++ b/uppsrc/Core/heap.cpp @@ -242,16 +242,16 @@ void MemoryShrink() #ifdef UPP_HEAP #include -void *operator new(size_t size) throw(std::bad_alloc) { void *ptr = UPP::MemoryAlloc(size); return ptr; } -void operator delete(void *ptr) throw() { UPP::MemoryFree(ptr); } +void *operator new(size_t size) throw() { void *ptr = UPP::MemoryAlloc(size); return ptr; } +void operator delete(void *ptr) throw() { UPP::MemoryFree(ptr); } -void *operator new[](size_t size) throw(std::bad_alloc) { void *ptr = UPP::MemoryAlloc(size); return ptr; } -void operator delete[](void *ptr) throw() { UPP::MemoryFree(ptr); } +void *operator new[](size_t size) throw() { void *ptr = UPP::MemoryAlloc(size); return ptr; } +void operator delete[](void *ptr) throw() { UPP::MemoryFree(ptr); } -void *operator new(size_t size, const std::nothrow_t&) throw() { void *ptr = UPP::MemoryAlloc(size); return ptr; } -void operator delete(void *ptr, const std::nothrow_t&) throw() { UPP::MemoryFree(ptr); } +void *operator new(size_t size, const std::nothrow_t&) throw() { void *ptr = UPP::MemoryAlloc(size); return ptr; } +void operator delete(void *ptr, const std::nothrow_t&) throw() { UPP::MemoryFree(ptr); } -void *operator new[](size_t size, const std::nothrow_t&) throw() { void *ptr = UPP::MemoryAlloc(size); return ptr; } +void *operator new[](size_t size, const std::nothrow_t&) throw() { void *ptr = UPP::MemoryAlloc(size); return ptr; } void operator delete[](void *ptr, const std::nothrow_t&) throw() { UPP::MemoryFree(ptr); } #endif diff --git a/uppsrc/Core/parser.cpp b/uppsrc/Core/parser.cpp index 98b290830..e88f731d8 100644 --- a/uppsrc/Core/parser.cpp +++ b/uppsrc/Core/parser.cpp @@ -139,31 +139,31 @@ bool CParser::Id0(const char *s) { return true; } -void CParser::PassId(const char *s) throw(Error) { +void CParser::PassId(const char *s) { LTIMING("PassId"); if(!Id(s)) ThrowError(String("missing '") + s + "\'"); } -void CParser::PassChar(char c) throw(Error) { +void CParser::PassChar(char c) { LTIMING("PassChar"); if(!Char(c)) ThrowError(String("missing '") + c + "\'"); } -void CParser::PassChar2(char c1, char c2) throw(Error) { +void CParser::PassChar2(char c1, char c2) { LTIMING("PassChar2"); if(!Char2(c1, c2)) ThrowError(String("missing '") + c1 + c2 + "\'"); } -void CParser::PassChar3(char c1, char c2, char c3) throw(Error) { +void CParser::PassChar3(char c1, char c2, char c3) { LTIMING("PassChar3"); if(!Char3(c1, c2, c3)) ThrowError(String("missing '") + c1 + c2 + c3 + "\'"); } -String CParser::ReadId() throw(Error) { +String CParser::ReadId() { LTIMING("ReadId"); if(!IsId()) ThrowError("missing id"); @@ -177,7 +177,7 @@ String CParser::ReadId() throw(Error) { return String(b, (int)(uintptr_t)(p - b)); } -String CParser::ReadIdt() throw(Error) { +String CParser::ReadIdt() { if(!IsId()) ThrowError("missing id"); StringBuffer result; @@ -217,7 +217,7 @@ int CParser::Sgn() return sign; } -int CParser::ReadInt() throw(Error) { +int CParser::ReadInt() { LTIMING("ReadInt"); int sign = Sgn(); uint32 n = ReadNumber(10); @@ -226,7 +226,7 @@ int CParser::ReadInt() throw(Error) { return sign * (int)n; } -int CParser::ReadInt(int min, int max) throw(Error) +int CParser::ReadInt(int min, int max) { int n = ReadInt(); if(n < min || n > max) @@ -234,7 +234,7 @@ int CParser::ReadInt(int min, int max) throw(Error) return n; } -int64 CParser::ReadInt64() throw(Error) +int64 CParser::ReadInt64() { LTIMING("ReadInt64"); int sign = Sgn(); @@ -244,7 +244,7 @@ int64 CParser::ReadInt64() throw(Error) return sign * n; } -int64 CParser::ReadInt64(int64 min, int64 max) throw(Error) +int64 CParser::ReadInt64(int64 min, int64 max) { int64 n = ReadInt64(); if(n < min || n > max) @@ -262,7 +262,7 @@ bool CParser::IsNumber(int base) const return q >= 0 && q < base - 10; } -uint32 CParser::ReadNumber(int base) throw(Error) +uint32 CParser::ReadNumber(int base) { LTIMING("ReadNumber"); uint32 n = 0; @@ -283,7 +283,7 @@ uint32 CParser::ReadNumber(int base) throw(Error) return n; } -uint64 CParser::ReadNumber64(int base) throw(Error) +uint64 CParser::ReadNumber64(int base) { LTIMING("ReadNumber"); uint64 n = 0; @@ -304,7 +304,7 @@ uint64 CParser::ReadNumber64(int base) throw(Error) return n; } -double CParser::ReadDouble() throw(Error) +double CParser::ReadDouble() { LTIMING("ReadDouble"); int sign = Sgn(); @@ -349,7 +349,7 @@ bool CParser::ReadHex(dword& hex, int n) return true; } -String CParser::ReadOneString(int delim, bool chkend) throw(Error) { +String CParser::ReadOneString(int delim, bool chkend) { if(!IsChar(delim)) ThrowError("missing string"); term++; @@ -441,12 +441,12 @@ String CParser::ReadOneString(int delim, bool chkend) throw(Error) { return result; } -String CParser::ReadOneString(bool chkend) throw(Error) +String CParser::ReadOneString(bool chkend) { return ReadOneString('\"', chkend); } -String CParser::ReadString(int delim, bool chkend) throw(Error) { +String CParser::ReadString(int delim, bool chkend) { LTIMING("ReadString"); String result; do @@ -455,7 +455,7 @@ String CParser::ReadString(int delim, bool chkend) throw(Error) { return result; } -String CParser::ReadString(bool chkend) throw(Error) +String CParser::ReadString(bool chkend) { return ReadString('\"', chkend); } diff --git a/uppsrc/Core/src.tpp/CParser$en-us.tpp b/uppsrc/Core/src.tpp/CParser$en-us.tpp index aef7b3b99..83e19b4de 100644 --- a/uppsrc/Core/src.tpp/CParser$en-us.tpp +++ b/uppsrc/Core/src.tpp/CParser$en-us.tpp @@ -166,22 +166,20 @@ by three characters and [* true] is returned. If no match is found position remains unmodified and [* false] is returned.&] [s3; &] [s4; &] -[s5;:CParser`:`:PassChar`(char`)throw`(CParser`:`:Error`): [@(0.0.255) void]_[* PassChar]( -[@(0.0.255) char]_[*@3 c])_[@(0.0.255) throw](Error)&] +[s5;:CParser`:`:PassChar`(char`): [@(0.0.255) void]_[* PassChar]([@(0.0.255) char]_[*@3 c])&] [s2;%% Calls [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Char`(char`)^ Char](c) . If it returns false, throws error.&] [s3; &] [s4; &] -[s5;:CParser`:`:PassChar2`(char`,char`)throw`(CParser`:`:Error`): [@(0.0.255) void]_[* Pa -ssChar2]([@(0.0.255) char]_[*@3 c1], [@(0.0.255) char]_[*@3 c2])_[@(0.0.255) throw](Error)&] +[s5;:CParser`:`:PassChar2`(char`,char`): [@(0.0.255) void]_[* PassChar2]([@(0.0.255) char]_ +[*@3 c1], [@(0.0.255) char]_[*@3 c2])&] [s2;%% Calls [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Char2`(char`,char`)^ C har2](c1, c2). If it returns [* false], throws [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Error`:`:struct^ C Parser`::Error].&] [s3; &] [s4; &] -[s5;:CParser`:`:PassChar3`(char`,char`,char`)throw`(CParser`:`:Error`): [@(0.0.255) voi -d]_[* PassChar3]([@(0.0.255) char]_[*@3 c1], [@(0.0.255) char]_[*@3 c2], -[@(0.0.255) char]_[*@3 c3])_[@(0.0.255) throw](Error)&] +[s5;:CParser`:`:PassChar3`(char`,char`,char`): [@(0.0.255) void]_[* PassChar3]([@(0.0.255) c +har]_[*@3 c1], [@(0.0.255) char]_[*@3 c2], [@(0.0.255) char]_[*@3 c3])&] [s2;%% Calls [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Char3`(char`,char`,char`)^ C har3](c1, c2, c3). If it returns [* false], throws [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Error`:`:struct^ C Parser`::Error].&] @@ -194,8 +192,8 @@ advances position by [* strlen](s) characters. Returns [* true] on match and [* false] otherwise.&] [s3; &] [s4; &] -[s5;:CParser`:`:PassId`(const char`*`)throw`(CParser`:`:Error`): [@(0.0.255) void]_[* Pas -sId]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 s])_[@(0.0.255) throw](Error)&] +[s5;:CParser`:`:PassId`(const char`*`): [@(0.0.255) void]_[* PassId]([@(0.0.255) const]_[@(0.0.255) c +har]_`*[*@3 s])_[@(0.0.255) throw](Error)&] [s2;%% Invokes the [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Id`(const char`*`)^ I d] method with [%-*@3 s] as parameter. If it returns [* false], throws [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Error`:`:struct^ CParser`::Error @@ -213,15 +211,13 @@ har]_`*[*@3 s])_[@(0.0.255) const]&] position.&] [s3;%% &] [s4; &] -[s5;:CParser`:`:ReadId`(`)throw`(CParser`:`:Error`): [_^String^ String]_[* ReadId]()_[@(0.0.255) t -hrow](Error)&] +[s5;:CParser`:`:ReadId`(`): [_^String^ String]_[* ReadId]()&] [s2;%% Reads C`-like identifier from the current position. If there is none, a [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Error`:`:struct^ CPa rser`::Error] is thrown.&] [s3; &] [s4; &] -[s5;:CParser`:`:ReadIdt`(`)throw`(CParser`:`:Error`): [_^String^ String]_[* ReadIdt]()_[@(0.0.255) t -hrow](Error)&] +[s5;:CParser`:`:ReadIdt`(`): [_^String^ String]_[* ReadIdt]()&] [s2;%% Special variant of [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:ReadId`(`)throw`(CParser`:`:Error`)^ R eadId] that considers different non`-alphanumeric characters to be the part of identifier as long as they form C`+`+ normal @@ -239,30 +235,27 @@ spaces and digit.&] skips them. If `'`-`' was skipped, returns `-1, otherwise 1.&] [s3; &] [s4; &] -[s5;:CParser`:`:ReadInt`(`)throw`(CParser`:`:Error`): [@(0.0.255) int]_[* ReadInt]()_[@(0.0.255) t -hrow](Error)&] +[s5;:CParser`:`:ReadInt`(`): [@(0.0.255) int]_[* ReadInt]()&] [s2;%% Reads the integer from the current position. If [* IsInt ]is false, throws an [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Error`:`:struct^ C Parser`::Error.]&] [s3; &] [s4; &] -[s5;:CParser`:`:ReadInt`(int`,int`)throw`(CParser`:`:Error`): [@(0.0.255) int]_[* ReadInt -]([@(0.0.255) int]_[*@3 min], [@(0.0.255) int]_[*@3 max])_[@(0.0.255) throw](Error)&] +[s5;:CParser`:`:ReadInt`(int`,int`): [@(0.0.255) int]_[* ReadInt]([@(0.0.255) int]_[*@3 min], + [@(0.0.255) int]_[*@3 max])&] [s2;%% Performs ReadInt and then checks the result to be in [%-*@3 min] <`= result <`= [%-*@3 max]. If not, throws a [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Error`:`:struct^ C Parser`::Error], otherwise returns it.&] [s3;%% &] [s4; &] -[s5;:CParser`:`:ReadInt64`(`)throw`(CParser`:`:Error`): [_^int64^ int64]_[* ReadInt64]()_ -[@(0.0.255) throw](Error)&] +[s5;:CParser`:`:ReadInt64`(`): [_^int64^ int64]_[* ReadInt64]()&] [s2;%% Reads the 64`-bit integer from the current position. If [* IsInt ]is false, throws an [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Error`:`:struct^ C Parser`::Error.]&] [s3; &] [s4; &] -[s5;:CParser`:`:ReadInt64`(int64`,int64`)throw`(CParser`:`:Error`): [_^int64^ int64]_[* R -eadInt64]([_^int64^ int64]_[*@3 min], [_^int64^ int64]_[*@3 max])_[@(0.0.255) throw](Error) -&] +[s5;:CParser`:`:ReadInt64`(int64`,int64`): [_^int64^ int64]_[* ReadInt64]([_^int64^ int64]_ +[*@3 min], [_^int64^ int64]_[*@3 max])&] [s2;%% Performs ReadInt64 and then checks the result to be in [%-*@3 min] <`= result <`= [%-*@3 max]. If not, throws a [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Error`:`:struct^ C Parser`::Error], otherwise returns it.&] @@ -281,15 +274,15 @@ is limit by actual [%-*@3 base ](e.g. for base 12 letters `'a`' `'A`' `'b`' `'B`' are allowed).&] [s3; &] [s4; &] -[s5;:CParser`:`:ReadNumber`(int`)throw`(CParser`:`:Error`): [_^uint32^ uint32]_[* ReadNum -ber]([@(0.0.255) int]_[*@3 base]_`=_[@3 10])_[@(0.0.255) throw](Error)&] +[s5;:CParser`:`:ReadNumber`(int`): [_^uint32^ uint32]_[* ReadNumber]([@(0.0.255) int]_[*@3 ba +se]_`=_[@3 10])&] [s2;%% Reads a number with the given numeric [%-*C@3 base]. If [* IsNumber]([%-*@3 base]) is false, throws an [^topic`:`/`/Core`/src`/CParser`$en`-us`#CParser`:`:Error`:`:struct^ C Parser`::Error.]&] [s3; &] [s4; &] -[s5;:CParser`:`:ReadNumber64`(int`)throw`(CParser`:`:Error`): [_^uint64^ uint64]_[* ReadN -umber64]([@(0.0.255) int]_[*@3 base]_`=_[@3 10])_[@(0.0.255) throw](Error)&] +[s5;:CParser`:`:ReadNumber64`(int`): [_^uint64^ uint64]_[* ReadNumber64]([@(0.0.255) int]_[*@3 b +ase]_`=_[@3 10])&] [s2;%% Reads 64`-bit unsigned number with given numeric [%-*@3 base].&] [s3;%% &] [s4; &] @@ -304,8 +297,7 @@ number of spaces and digit.&] with decimal point, like `'.21`'.&] [s3; &] [s4; &] -[s5;:CParser`:`:ReadDouble`(`)throw`(CParser`:`:Error`): [@(0.0.255) double]_[* ReadDoubl -e]()_[@(0.0.255) throw](Error)&] +[s5;:CParser`:`:ReadDouble`(`): [@(0.0.255) double]_[* ReadDouble]()&] [s2;%% Reads a floating point number with C based lexical rules. As an exception to C lexical rules, ReadDouble also recognizes form starting with decimal point, like `".21`".&] @@ -316,9 +308,8 @@ form starting with decimal point, like `".21`".&] Same as [* IsChar](`'`\`"`');&] [s3; &] [s4; &] -[s5;:CParser`:`:ReadOneString`(bool`)throw`(CParser`:`:Error`): [_^String^ String]_[* Rea -dOneString]([@(0.0.255) bool]_[*@3 chkend]_`=_[@(0.0.255) true])_[@(0.0.255) throw](Error -)&] +[s5;:CParser`:`:ReadOneString`(bool`): [_^String^ String]_[* ReadOneString]([@(0.0.255) boo +l]_[*@3 chkend]_`=_[@(0.0.255) true])&] [s2;%% Reads C`-like string literal from current position (follow C lexical rules, including escape codes). Literals on different lines are not concatenated (unlike C). When [%-*C@3 chkend] is @@ -327,8 +318,8 @@ string literals `- string is then also delimited by end of line or text.&] [s3; &] [s4; &] -[s5;:CParser`:`:ReadString`(bool`)throw`(CParser`:`:Error`): [_^String^ String]_[* ReadSt -ring]([@(0.0.255) bool]_[*@3 chkend]_`=_[@(0.0.255) true])_[@(0.0.255) throw](Error)&] +[s5;:CParser`:`:ReadString`(bool`): [_^String^ String]_[* ReadString]([@(0.0.255) bool]_[*@3 c +hkend]_`=_[@(0.0.255) true])&] [s2;%% Reads C`-like string literal from current position (follow C lexical rules, including escape codes). Literals on different lines are concatenated (as in C). When [%-*C@3 chkend] is [* false], @@ -337,9 +328,8 @@ string literals `- string is then also delimited by end of line or text.&] [s3; &] [s4; &] -[s5;:CParser`:`:ReadOneString`(int`,bool`)throw`(CParser`:`:Error`): [_^String^ String]_ -[* ReadOneString]([@(0.0.255) int]_[*@3 delim], [@(0.0.255) bool]_[*@3 chkend]_`=_[@(0.0.255) t -rue])_[@(0.0.255) throw](Error)&] +[s5;:CParser`:`:ReadOneString`(int`,bool`): [_^String^ String]_[* ReadOneString]([@(0.0.255) i +nt]_[*@3 delim], [@(0.0.255) bool]_[*@3 chkend]_`=_[@(0.0.255) true])&] [s2;%% Reads C`-like string literal from current position (follow C lexical rules, including escape codes) with different delimiter [%-*C@3 delim] than `'`\`"`'. Literals on different lines are not @@ -348,9 +338,8 @@ concatenated (unlike C). When [%-*C@3 chkend] is false, [* ReadOneString `- string is then also delimited by end of line or text.&] [s3; &] [s4; &] -[s5;:CParser`:`:ReadString`(int`,bool`)throw`(CParser`:`:Error`): [_^String^ String]_[* R -eadString]([@(0.0.255) int]_[*@3 delim], [@(0.0.255) bool]_[*@3 chkend]_`=_[@(0.0.255) true -])_[@(0.0.255) throw](Error)&] +[s5;:CParser`:`:ReadString`(int`,bool`): [_^String^ String]_[* ReadString]([@(0.0.255) int]_ +[*@3 delim], [@(0.0.255) bool]_[*@3 chkend]_`=_[@(0.0.255) true])&] [s2;%% Reads C`-like string literal from current position (follow C lexical rules, including escape codes). with different delimiter [%-*C@3 delim] than `'`\`"`'. Literals on different lines are concatenated diff --git a/uppsrc/Core/src.tpp/WebSocket$en-us.tpp b/uppsrc/Core/src.tpp/WebSocket$en-us.tpp index a5a1984f8..9b6ab4db5 100644 --- a/uppsrc/Core/src.tpp/WebSocket$en-us.tpp +++ b/uppsrc/Core/src.tpp/WebSocket$en-us.tpp @@ -120,6 +120,19 @@ onst]_[_^Upp`:`:String^ String][@(0.0.255) `&]_[*@3 msg])&] [s5;:WebSocket`:`:IsClosed`(`)const: [@(0.0.255) bool]_[* IsClosed]()_[@(0.0.255) const]&] [s2;%% Returns true if the socket is closed.&] [s4; &] +[s5;:Upp`:`:WebSocket`:`:GetWaitEvents`(`)const: [_^Upp`:`:dword^ dword]_[* GetWaitEvents +]()_[@(0.0.255) const]&] +[s2;%% Returns a combination of WAIT`_READ and WAIT`_WRITE flags +to indicate what is blocking the operation of WebSocket. Can +be used with SocketWaitEvent.&] +[s3; &] +[s4; &] +[s5;:Upp`:`:WebSocket`:`:GetSOCKET`(`)const: [_^SOCKET^ SOCKET]_[* GetSOCKET]()_[@(0.0.255) c +onst]&] +[s2;%% Is there associated socket, returns its handle. Otherwise +returns NULL.&] +[s3; &] +[s4; &] [s5;:Upp`:`:WebSocket`:`:AddTo`(Upp`:`:SocketWaitEvent`&`): [@(0.0.255) void]_[* AddTo]([_^Upp`:`:SocketWaitEvent^ S ocketWaitEvent][@(0.0.255) `&]_[*@3 e])&] [s2;%% Adds WebSocket to [%-_^Upp`:`:SocketWaitEvent^ SocketWaitEvent]