@dmarket/p2p-tracker-headless 0.0.0-bootstrap.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Kotlin-DateTime-library-kotlinx-datetime.mjs +4 -0
- package/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -0
- package/VERSION +14 -0
- package/dmarket-p2p-tracker-core-domain.mjs +16699 -0
- package/dmarket-p2p-tracker-core-domain.mjs.map +1 -0
- package/index.d.ts +195 -0
- package/kotlin-kotlin-stdlib.mjs +18834 -0
- package/kotlin-kotlin-stdlib.mjs.map +1 -0
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs +4 -0
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map +1 -0
- package/kotlinx-atomicfu.mjs +251 -0
- package/kotlinx-atomicfu.mjs.map +1 -0
- package/kotlinx-browser.mjs +8 -0
- package/kotlinx-browser.mjs.map +1 -0
- package/kotlinx-coroutines-core.mjs +12437 -0
- package/kotlinx-coroutines-core.mjs.map +1 -0
- package/kotlinx-io-kotlinx-io-bytestring.mjs +202 -0
- package/kotlinx-io-kotlinx-io-bytestring.mjs.map +1 -0
- package/kotlinx-io-kotlinx-io-core.mjs +2034 -0
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -0
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +6163 -0
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -0
- package/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
- package/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -0
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +5957 -0
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
- package/ktor-ktor-client-content-negotiation.mjs +4 -0
- package/ktor-ktor-client-content-negotiation.mjs.map +1 -0
- package/ktor-ktor-client-core.mjs +9986 -0
- package/ktor-ktor-client-core.mjs.map +1 -0
- package/ktor-ktor-events.mjs +82 -0
- package/ktor-ktor-events.mjs.map +1 -0
- package/ktor-ktor-http-cio.mjs +2253 -0
- package/ktor-ktor-http-cio.mjs.map +1 -0
- package/ktor-ktor-http.mjs +3261 -0
- package/ktor-ktor-http.mjs.map +1 -0
- package/ktor-ktor-io.mjs +3546 -0
- package/ktor-ktor-io.mjs.map +1 -0
- package/ktor-ktor-openapi-schema.mjs +4 -0
- package/ktor-ktor-openapi-schema.mjs.map +1 -0
- package/ktor-ktor-serialization-kotlinx-json.mjs +4 -0
- package/ktor-ktor-serialization-kotlinx-json.mjs.map +1 -0
- package/ktor-ktor-serialization-kotlinx.mjs +4 -0
- package/ktor-ktor-serialization-kotlinx.mjs.map +1 -0
- package/ktor-ktor-serialization.mjs +4 -0
- package/ktor-ktor-serialization.mjs.map +1 -0
- package/ktor-ktor-sse.mjs +4 -0
- package/ktor-ktor-sse.mjs.map +1 -0
- package/ktor-ktor-utils.mjs +3427 -0
- package/ktor-ktor-utils.mjs.map +1 -0
- package/ktor-ktor-websocket-serialization.mjs +4 -0
- package/ktor-ktor-websocket-serialization.mjs.map +1 -0
- package/ktor-ktor-websockets.mjs +2589 -0
- package/ktor-ktor-websockets.mjs.map +1 -0
- package/p2p-tracker-core.mjs +41977 -0
- package/p2p-tracker-core.mjs.map +1 -0
- package/p2p-tracker-headless.mjs +4939 -0
- package/p2p-tracker-headless.mjs.map +1 -0
- package/package.json +58 -0
- package/pkg/README.md +104 -0
- package/pkg/client_wasm.d.ts +316 -0
- package/pkg/client_wasm.js +1199 -0
- package/pkg/client_wasm_bg.wasm +0 -0
- package/pkg/client_wasm_bg.wasm.d.ts +32 -0
- package/pkg/package.json +19 -0
- package/pkg/snippets/web-spawn-05868593a72e2d44/js/spawn.js +73 -0
- package/pkg/spawn.js +73 -0
- package/prover-child.mjs +2 -0
- package/transport/README.md +240 -0
- package/transport/dist/channel.d.ts +48 -0
- package/transport/dist/channel.d.ts.map +1 -0
- package/transport/dist/channel.js +150 -0
- package/transport/dist/channel.js.map +1 -0
- package/transport/dist/index.d.ts +10 -0
- package/transport/dist/index.d.ts.map +1 -0
- package/transport/dist/index.js +19 -0
- package/transport/dist/index.js.map +1 -0
- package/transport/dist/node.d.ts +4 -0
- package/transport/dist/node.d.ts.map +1 -0
- package/transport/dist/node.js +62 -0
- package/transport/dist/node.js.map +1 -0
- package/transport/dist/prover.d.ts +105 -0
- package/transport/dist/prover.d.ts.map +1 -0
- package/transport/dist/prover.js +139 -0
- package/transport/dist/prover.js.map +1 -0
- package/transport/dist/tcp.d.ts +38 -0
- package/transport/dist/tcp.d.ts.map +1 -0
- package/transport/dist/tcp.js +88 -0
- package/transport/dist/tcp.js.map +1 -0
- package/transport/dist/transport.d.ts +31 -0
- package/transport/dist/transport.d.ts.map +1 -0
- package/transport/dist/transport.js +75 -0
- package/transport/dist/transport.js.map +1 -0
- package/transport/dist/types.d.ts +162 -0
- package/transport/dist/types.d.ts.map +1 -0
- package/transport/dist/types.js +21 -0
- package/transport/dist/types.js.map +1 -0
- package/transport/dist/wasm-compat.d.ts +2 -0
- package/transport/dist/wasm-compat.d.ts.map +1 -0
- package/transport/dist/wasm-compat.js +15 -0
- package/transport/dist/wasm-compat.js.map +1 -0
- package/transport/package.json +34 -0
|
@@ -0,0 +1,2589 @@
|
|
|
1
|
+
import {
|
|
2
|
+
collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
|
|
3
|
+
mapCapacity1h45rc3eh9p2l as mapCapacity,
|
|
4
|
+
coerceAtLeast2bkz8m9ik7hep as coerceAtLeast,
|
|
5
|
+
LinkedHashMap_init_$Create$1gaaqjdgvat9g as LinkedHashMap_init_$Create$,
|
|
6
|
+
Unit_instance3vdlo4e4f5ggx as Unit_instance,
|
|
7
|
+
protoOf180f3jzyo7rfj as protoOf,
|
|
8
|
+
initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
|
|
9
|
+
enumEntries20mr21zbe3az4 as enumEntries,
|
|
10
|
+
objectCreate1ve4bgxiu4x98 as objectCreate,
|
|
11
|
+
Enum3alwj03lh1n41 as Enum,
|
|
12
|
+
initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
|
|
13
|
+
VOID3gxj6tk5isa35 as VOID,
|
|
14
|
+
toString1pkumu07cwy4m as toString,
|
|
15
|
+
IllegalArgumentException_init_$Create$1mgk48flhjim3 as IllegalArgumentException_init_$Create$,
|
|
16
|
+
getStringHashCode26igk1bx568vk as getStringHashCode,
|
|
17
|
+
substringiqarkczpya5m as substring,
|
|
18
|
+
charCodeAt1yspne1d8erbm as charCodeAt,
|
|
19
|
+
Char__toInt_impl_vasixd1ka89vowck9tn as Char__toInt_impl_vasixd,
|
|
20
|
+
isHighSurrogate11jfjw70ar0zf as isHighSurrogate,
|
|
21
|
+
isLowSurrogateujxcv7hjn4ma as isLowSurrogate,
|
|
22
|
+
initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
|
|
23
|
+
Long2qws0ah9gnpki as Long,
|
|
24
|
+
isInterface3d6p8outrmvmk as isInterface,
|
|
25
|
+
compare2uud5j30pw5xc as compare,
|
|
26
|
+
CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl,
|
|
27
|
+
THROW_CCE2g6jy02ryeudk as THROW_CCE,
|
|
28
|
+
get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED,
|
|
29
|
+
initMetadataForLambda3af3he42mmnh as initMetadataForLambda,
|
|
30
|
+
constructCallableReference23y65rf941mch as constructCallableReference,
|
|
31
|
+
ensureNotNull1e947j3ixpazm as ensureNotNull,
|
|
32
|
+
CancellationException_init_$Create$3mozl5zk7b7i2 as CancellationException_init_$Create$,
|
|
33
|
+
CancellationException3b36o9qz53rgr as CancellationException,
|
|
34
|
+
initMetadataForCoroutine1i7lbatuf5bnt as initMetadataForCoroutine,
|
|
35
|
+
toString30pk9tzaqopn as toString_0,
|
|
36
|
+
fromInt1lka3ktyu79a4 as fromInt,
|
|
37
|
+
ArrayList_init_$Create$1z3aa4voswqq as ArrayList_init_$Create$,
|
|
38
|
+
IllegalStateException_init_$Create$3394faf8tdm0h as IllegalStateException_init_$Create$,
|
|
39
|
+
joinToString1cxrrlmo0chqs as joinToString,
|
|
40
|
+
initMetadataForObject1cxne3s9w65el as initMetadataForObject,
|
|
41
|
+
Exceptiondt2hlxn7j7vw as Exception,
|
|
42
|
+
Exception_init_$Init$3okdru6mzytq2 as Exception_init_$Init$,
|
|
43
|
+
captureStack1fzi4aczwc4hg as captureStack,
|
|
44
|
+
defineProp3ur6h3slcvq4x as defineProp,
|
|
45
|
+
compareTo3ankvs086tmwq as compareTo,
|
|
46
|
+
decodeToString1dbzcjd620q25 as decodeToString,
|
|
47
|
+
Randomei1bbeye8rr8 as Random,
|
|
48
|
+
toHexString5bhtjxqec7ow as toHexString,
|
|
49
|
+
throwUninitializedPropertyAccessException14fok093f3k3t as throwUninitializedPropertyAccessException,
|
|
50
|
+
RuntimeException1r3t0zl97011n as RuntimeException,
|
|
51
|
+
RuntimeException_init_$Init$24zelexl34ubl as RuntimeException_init_$Init$,
|
|
52
|
+
ArrayList_init_$Create$3o344dm0ee4ws as ArrayList_init_$Create$_0,
|
|
53
|
+
split2bvyvnrlcifjv as split,
|
|
54
|
+
first58ocm7j58k3q as first,
|
|
55
|
+
isCharSequence1ju9jr1w86plq as isCharSequence,
|
|
56
|
+
trim11nh7r46at6sx as trim,
|
|
57
|
+
drop3na99dw9feawf as drop,
|
|
58
|
+
noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
|
|
59
|
+
} from './kotlin-kotlin-stdlib.mjs';
|
|
60
|
+
import {
|
|
61
|
+
Dispatchers_getInstance20p7pyqnrepag as Dispatchers_getInstance,
|
|
62
|
+
launch1c91vkjzdi9sd as launch,
|
|
63
|
+
CoroutineStart_UNDISPATCHED_getInstance2pq896dvru5v1 as CoroutineStart_UNDISPATCHED_getInstance,
|
|
64
|
+
ChannelResult2y4k69ac6y3du as ChannelResult,
|
|
65
|
+
_ChannelResult___get_isSuccess__impl__odq1z9t6ktwy0g0q0f as _ChannelResult___get_isSuccess__impl__odq1z9,
|
|
66
|
+
CoroutineScopefcb5f5dwqcas as CoroutineScope,
|
|
67
|
+
cancelConsumed2i0oizqhmljf6 as cancelConsumed,
|
|
68
|
+
ClosedSendChannelException29m33prpq9jaw as ClosedSendChannelException,
|
|
69
|
+
ClosedReceiveChannelException3ofg6gf5f5b38 as ClosedReceiveChannelException,
|
|
70
|
+
CompletableDeferred2lnqvsbvx74d3 as CompletableDeferred,
|
|
71
|
+
Job13y4jkazwjho0 as Job,
|
|
72
|
+
Key_instancebefxze3q9f64 as Key_instance,
|
|
73
|
+
CoroutineName2g5zosw74tf0f as CoroutineName,
|
|
74
|
+
Factory_getInstance32nnliw9sj63p as Factory_getInstance,
|
|
75
|
+
DisposableHandle1uzxt8frdchxn as DisposableHandle,
|
|
76
|
+
CopyableThrowable1mvc99jcyvivf as CopyableThrowable,
|
|
77
|
+
Channel3r72atmcithql as Channel,
|
|
78
|
+
withTimeoutOrNull3qi35nuwr2k8a as withTimeoutOrNull,
|
|
79
|
+
BufferOverflow_SUSPEND_getInstanceob833ibjouyy as BufferOverflow_SUSPEND_getInstance,
|
|
80
|
+
BufferOverflow_DROP_OLDEST_getInstanceckq6sjfawt4w as BufferOverflow_DROP_OLDEST_getInstance,
|
|
81
|
+
_ChannelResult___get_isClosed__impl__mg7kuu3a26on4apn4j4 as _ChannelResult___get_isClosed__impl__mg7kuu,
|
|
82
|
+
close$defaultlxi0kykibhye as close$default,
|
|
83
|
+
cancel$default2imfx8rp1ubvu as cancel$default,
|
|
84
|
+
SendChannel38sllbxw662ws as SendChannel,
|
|
85
|
+
ReceiveChannel24wu5e2tj9lbp as ReceiveChannel,
|
|
86
|
+
} from './kotlinx-coroutines-core.mjs';
|
|
87
|
+
import {
|
|
88
|
+
get_isTraceEnabled82xibuu04nxp as get_isTraceEnabled,
|
|
89
|
+
ChannelIOException2i3t76lsrbgox as ChannelIOException,
|
|
90
|
+
KtorSimpleLogger1xdphsp5l4e48 as KtorSimpleLogger,
|
|
91
|
+
getTimeMillis12o7k17x9fmwi as getTimeMillis,
|
|
92
|
+
} from './ktor-ktor-utils.mjs';
|
|
93
|
+
import {
|
|
94
|
+
BytePacketBuilder2biodf4wxvlba as BytePacketBuilder,
|
|
95
|
+
writeFully359t6q8kam2g5 as writeFully,
|
|
96
|
+
buildjygoh729rhy8 as build,
|
|
97
|
+
get_size2imoy2jq11jxl as get_size,
|
|
98
|
+
readText27783kyxjxi1g as readText,
|
|
99
|
+
Charsets_getInstance3jooo7e4x0j2x as Charsets_getInstance,
|
|
100
|
+
toByteArray1i3ns5jnoqlv6 as toByteArray,
|
|
101
|
+
ClosedByteChannelException3il8gfpye60w as ClosedByteChannelException,
|
|
102
|
+
writeText19qfzm98fbm4l as writeText,
|
|
103
|
+
} from './ktor-ktor-io.mjs';
|
|
104
|
+
import {
|
|
105
|
+
readByteArray1ri21h2rciakw as readByteArray,
|
|
106
|
+
IOException_init_$Create$30ael4xxp8cz as IOException_init_$Create$,
|
|
107
|
+
Buffergs925ekssbch as Buffer,
|
|
108
|
+
} from './kotlinx-io-kotlinx-io-core.mjs';
|
|
109
|
+
import {
|
|
110
|
+
atomic$ref$130aurmcwdfdf1 as atomic$ref$1,
|
|
111
|
+
atomic$boolean$1iggki4z65a2h as atomic$boolean$1,
|
|
112
|
+
} from './kotlinx-atomicfu.mjs';
|
|
113
|
+
//region block: imports
|
|
114
|
+
var imul = Math.imul;
|
|
115
|
+
//endregion
|
|
116
|
+
//region block: pre-declaration
|
|
117
|
+
initMetadataForCompanion(Companion);
|
|
118
|
+
initMetadataForClass(Codes, 'Codes', VOID, Enum);
|
|
119
|
+
initMetadataForCompanion(Companion_0);
|
|
120
|
+
initMetadataForClass(CloseReason, 'CloseReason');
|
|
121
|
+
function send(frame, $completion) {
|
|
122
|
+
return this.c3l().g1f(frame, $completion);
|
|
123
|
+
}
|
|
124
|
+
initMetadataForInterface(WebSocketSession, 'WebSocketSession', VOID, VOID, [CoroutineScope], [1, 0]);
|
|
125
|
+
initMetadataForInterface(DefaultWebSocketSession, 'DefaultWebSocketSession', VOID, VOID, [WebSocketSession], [1, 0]);
|
|
126
|
+
initMetadataForCompanion(Companion_1);
|
|
127
|
+
initMetadataForLambda(DefaultWebSocketSessionImpl$start$slambda, CoroutineImpl, VOID, [1]);
|
|
128
|
+
initMetadataForLambda(DefaultWebSocketSessionImpl$runIncomingProcessor$slambda, CoroutineImpl, VOID, [1]);
|
|
129
|
+
initMetadataForLambda(DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda, CoroutineImpl, VOID, [1]);
|
|
130
|
+
initMetadataForLambda(DefaultWebSocketSessionImpl$runOrCancelPinger$slambda, CoroutineImpl, VOID, [1]);
|
|
131
|
+
initMetadataForCoroutine($outgoingProcessorLoopCOROUTINE$, CoroutineImpl);
|
|
132
|
+
initMetadataForCoroutine($sendCloseSequenceCOROUTINE$, CoroutineImpl);
|
|
133
|
+
initMetadataForCoroutine($checkMaxFrameSizeCOROUTINE$, CoroutineImpl);
|
|
134
|
+
initMetadataForClass(DefaultWebSocketSessionImpl, 'DefaultWebSocketSessionImpl', VOID, VOID, [DefaultWebSocketSession, WebSocketSession], [1, 0, 2]);
|
|
135
|
+
initMetadataForObject(NonDisposableHandle, 'NonDisposableHandle', VOID, VOID, [DisposableHandle]);
|
|
136
|
+
initMetadataForClass(FrameTooBigException, 'FrameTooBigException', VOID, Exception, [CopyableThrowable]);
|
|
137
|
+
initMetadataForCompanion(Companion_2);
|
|
138
|
+
initMetadataForClass(FrameType, 'FrameType', VOID, Enum);
|
|
139
|
+
initMetadataForLambda(ponger$slambda, CoroutineImpl, VOID, [1]);
|
|
140
|
+
initMetadataForLambda(pinger$slambda$slambda, CoroutineImpl, VOID, [1]);
|
|
141
|
+
initMetadataForLambda(pinger$slambda$slambda_1, CoroutineImpl, VOID, [1]);
|
|
142
|
+
initMetadataForLambda(pinger$slambda, CoroutineImpl, VOID, [1]);
|
|
143
|
+
initMetadataForCompanion(Companion_3);
|
|
144
|
+
initMetadataForClass(WebSocketChannelsConfig, 'WebSocketChannelsConfig', WebSocketChannelsConfig);
|
|
145
|
+
initMetadataForCompanion(Companion_4);
|
|
146
|
+
initMetadataForClass(ChannelConfig, 'ChannelConfig');
|
|
147
|
+
initMetadataForClass(ChannelOverflow, 'ChannelOverflow', VOID, Enum);
|
|
148
|
+
initMetadataForCompanion(Companion_5);
|
|
149
|
+
initMetadataForClass(BoundedChannel, 'BoundedChannel', VOID, VOID, [SendChannel, ReceiveChannel], [1, 0]);
|
|
150
|
+
initMetadataForClass(ChannelOverflowException, 'ChannelOverflowException', VOID, RuntimeException);
|
|
151
|
+
initMetadataForInterface(WebSocketExtension, 'WebSocketExtension');
|
|
152
|
+
initMetadataForClass(WebSocketExtensionsConfig, 'WebSocketExtensionsConfig', WebSocketExtensionsConfig);
|
|
153
|
+
initMetadataForClass(WebSocketExtensionHeader, 'WebSocketExtensionHeader');
|
|
154
|
+
initMetadataForCoroutine($closeCOROUTINE$, CoroutineImpl);
|
|
155
|
+
initMetadataForClass(Frame, 'Frame');
|
|
156
|
+
initMetadataForClass(Binary, 'Binary', VOID, Frame);
|
|
157
|
+
initMetadataForClass(Text, 'Text', VOID, Frame);
|
|
158
|
+
initMetadataForClass(Close, 'Close', Close_init_$Create$_0, Frame);
|
|
159
|
+
initMetadataForClass(Ping, 'Ping', VOID, Frame);
|
|
160
|
+
initMetadataForClass(Pong, 'Pong', VOID, Frame);
|
|
161
|
+
initMetadataForCompanion(Companion_6);
|
|
162
|
+
//endregion
|
|
163
|
+
var Codes_NORMAL_instance;
|
|
164
|
+
var Codes_GOING_AWAY_instance;
|
|
165
|
+
var Codes_PROTOCOL_ERROR_instance;
|
|
166
|
+
var Codes_CANNOT_ACCEPT_instance;
|
|
167
|
+
var Codes_CLOSED_ABNORMALLY_instance;
|
|
168
|
+
var Codes_NOT_CONSISTENT_instance;
|
|
169
|
+
var Codes_VIOLATED_POLICY_instance;
|
|
170
|
+
var Codes_TOO_BIG_instance;
|
|
171
|
+
var Codes_NO_EXTENSION_instance;
|
|
172
|
+
var Codes_INTERNAL_ERROR_instance;
|
|
173
|
+
var Codes_SERVICE_RESTART_instance;
|
|
174
|
+
var Codes_TRY_AGAIN_LATER_instance;
|
|
175
|
+
function Companion() {
|
|
176
|
+
Companion_instance = this;
|
|
177
|
+
var tmp = this;
|
|
178
|
+
// Inline function 'kotlin.collections.associateBy' call
|
|
179
|
+
var this_0 = get_entries();
|
|
180
|
+
var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
|
|
181
|
+
// Inline function 'kotlin.collections.associateByTo' call
|
|
182
|
+
var destination = LinkedHashMap_init_$Create$(capacity);
|
|
183
|
+
var _iterator__ex2g4s = this_0.t();
|
|
184
|
+
while (_iterator__ex2g4s.u()) {
|
|
185
|
+
var element = _iterator__ex2g4s.v();
|
|
186
|
+
var tmp$ret$2 = element.g3k_1;
|
|
187
|
+
destination.f3(tmp$ret$2, element);
|
|
188
|
+
}
|
|
189
|
+
tmp.h3k_1 = destination;
|
|
190
|
+
this.i3k_1 = Codes_INTERNAL_ERROR_getInstance();
|
|
191
|
+
}
|
|
192
|
+
protoOf(Companion).j3k = function (code) {
|
|
193
|
+
return this.h3k_1.w2(code);
|
|
194
|
+
};
|
|
195
|
+
var Companion_instance;
|
|
196
|
+
function Companion_getInstance() {
|
|
197
|
+
Codes_initEntries();
|
|
198
|
+
if (Companion_instance == null)
|
|
199
|
+
new Companion();
|
|
200
|
+
return Companion_instance;
|
|
201
|
+
}
|
|
202
|
+
function values() {
|
|
203
|
+
return [Codes_NORMAL_getInstance(), Codes_GOING_AWAY_getInstance(), Codes_PROTOCOL_ERROR_getInstance(), Codes_CANNOT_ACCEPT_getInstance(), Codes_CLOSED_ABNORMALLY_getInstance(), Codes_NOT_CONSISTENT_getInstance(), Codes_VIOLATED_POLICY_getInstance(), Codes_TOO_BIG_getInstance(), Codes_NO_EXTENSION_getInstance(), Codes_INTERNAL_ERROR_getInstance(), Codes_SERVICE_RESTART_getInstance(), Codes_TRY_AGAIN_LATER_getInstance()];
|
|
204
|
+
}
|
|
205
|
+
function get_entries() {
|
|
206
|
+
if ($ENTRIES == null)
|
|
207
|
+
$ENTRIES = enumEntries(values());
|
|
208
|
+
return $ENTRIES;
|
|
209
|
+
}
|
|
210
|
+
var Codes_entriesInitialized;
|
|
211
|
+
function Codes_initEntries() {
|
|
212
|
+
if (Codes_entriesInitialized)
|
|
213
|
+
return Unit_instance;
|
|
214
|
+
Codes_entriesInitialized = true;
|
|
215
|
+
Codes_NORMAL_instance = new Codes('NORMAL', 0, 1000);
|
|
216
|
+
Codes_GOING_AWAY_instance = new Codes('GOING_AWAY', 1, 1001);
|
|
217
|
+
Codes_PROTOCOL_ERROR_instance = new Codes('PROTOCOL_ERROR', 2, 1002);
|
|
218
|
+
Codes_CANNOT_ACCEPT_instance = new Codes('CANNOT_ACCEPT', 3, 1003);
|
|
219
|
+
Codes_CLOSED_ABNORMALLY_instance = new Codes('CLOSED_ABNORMALLY', 4, 1006);
|
|
220
|
+
Codes_NOT_CONSISTENT_instance = new Codes('NOT_CONSISTENT', 5, 1007);
|
|
221
|
+
Codes_VIOLATED_POLICY_instance = new Codes('VIOLATED_POLICY', 6, 1008);
|
|
222
|
+
Codes_TOO_BIG_instance = new Codes('TOO_BIG', 7, 1009);
|
|
223
|
+
Codes_NO_EXTENSION_instance = new Codes('NO_EXTENSION', 8, 1010);
|
|
224
|
+
Codes_INTERNAL_ERROR_instance = new Codes('INTERNAL_ERROR', 9, 1011);
|
|
225
|
+
Codes_SERVICE_RESTART_instance = new Codes('SERVICE_RESTART', 10, 1012);
|
|
226
|
+
Codes_TRY_AGAIN_LATER_instance = new Codes('TRY_AGAIN_LATER', 11, 1013);
|
|
227
|
+
Companion_getInstance();
|
|
228
|
+
}
|
|
229
|
+
var $ENTRIES;
|
|
230
|
+
function CloseReason_init_$Init$(code, message, $this) {
|
|
231
|
+
CloseReason.call($this, code.g3k_1, message);
|
|
232
|
+
return $this;
|
|
233
|
+
}
|
|
234
|
+
function CloseReason_init_$Create$(code, message) {
|
|
235
|
+
return CloseReason_init_$Init$(code, message, objectCreate(protoOf(CloseReason)));
|
|
236
|
+
}
|
|
237
|
+
function Codes(name, ordinal, code) {
|
|
238
|
+
Enum.call(this, name, ordinal);
|
|
239
|
+
this.g3k_1 = code;
|
|
240
|
+
}
|
|
241
|
+
function Companion_0() {
|
|
242
|
+
}
|
|
243
|
+
var Companion_instance_0;
|
|
244
|
+
function Companion_getInstance_0() {
|
|
245
|
+
return Companion_instance_0;
|
|
246
|
+
}
|
|
247
|
+
function Codes_NORMAL_getInstance() {
|
|
248
|
+
Codes_initEntries();
|
|
249
|
+
return Codes_NORMAL_instance;
|
|
250
|
+
}
|
|
251
|
+
function Codes_GOING_AWAY_getInstance() {
|
|
252
|
+
Codes_initEntries();
|
|
253
|
+
return Codes_GOING_AWAY_instance;
|
|
254
|
+
}
|
|
255
|
+
function Codes_PROTOCOL_ERROR_getInstance() {
|
|
256
|
+
Codes_initEntries();
|
|
257
|
+
return Codes_PROTOCOL_ERROR_instance;
|
|
258
|
+
}
|
|
259
|
+
function Codes_CANNOT_ACCEPT_getInstance() {
|
|
260
|
+
Codes_initEntries();
|
|
261
|
+
return Codes_CANNOT_ACCEPT_instance;
|
|
262
|
+
}
|
|
263
|
+
function Codes_CLOSED_ABNORMALLY_getInstance() {
|
|
264
|
+
Codes_initEntries();
|
|
265
|
+
return Codes_CLOSED_ABNORMALLY_instance;
|
|
266
|
+
}
|
|
267
|
+
function Codes_NOT_CONSISTENT_getInstance() {
|
|
268
|
+
Codes_initEntries();
|
|
269
|
+
return Codes_NOT_CONSISTENT_instance;
|
|
270
|
+
}
|
|
271
|
+
function Codes_VIOLATED_POLICY_getInstance() {
|
|
272
|
+
Codes_initEntries();
|
|
273
|
+
return Codes_VIOLATED_POLICY_instance;
|
|
274
|
+
}
|
|
275
|
+
function Codes_TOO_BIG_getInstance() {
|
|
276
|
+
Codes_initEntries();
|
|
277
|
+
return Codes_TOO_BIG_instance;
|
|
278
|
+
}
|
|
279
|
+
function Codes_NO_EXTENSION_getInstance() {
|
|
280
|
+
Codes_initEntries();
|
|
281
|
+
return Codes_NO_EXTENSION_instance;
|
|
282
|
+
}
|
|
283
|
+
function Codes_INTERNAL_ERROR_getInstance() {
|
|
284
|
+
Codes_initEntries();
|
|
285
|
+
return Codes_INTERNAL_ERROR_instance;
|
|
286
|
+
}
|
|
287
|
+
function Codes_SERVICE_RESTART_getInstance() {
|
|
288
|
+
Codes_initEntries();
|
|
289
|
+
return Codes_SERVICE_RESTART_instance;
|
|
290
|
+
}
|
|
291
|
+
function Codes_TRY_AGAIN_LATER_getInstance() {
|
|
292
|
+
Codes_initEntries();
|
|
293
|
+
return Codes_TRY_AGAIN_LATER_instance;
|
|
294
|
+
}
|
|
295
|
+
function CloseReason(code, message) {
|
|
296
|
+
this.k3k_1 = code;
|
|
297
|
+
this.l3k_1 = message;
|
|
298
|
+
var size = utf8Size(this.l3k_1);
|
|
299
|
+
// Inline function 'kotlin.require' call
|
|
300
|
+
if (!(size <= 123)) {
|
|
301
|
+
var message_0 = 'Close reason message is too long: ' + size + ' bytes, but must not exceed ' + '123 bytes when UTF-8-encoded';
|
|
302
|
+
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
protoOf(CloseReason).m3k = function () {
|
|
306
|
+
return Companion_getInstance().j3k(this.k3k_1);
|
|
307
|
+
};
|
|
308
|
+
protoOf(CloseReason).toString = function () {
|
|
309
|
+
var tmp0_elvis_lhs = this.m3k();
|
|
310
|
+
return 'CloseReason(reason=' + toString(tmp0_elvis_lhs == null ? this.k3k_1 : tmp0_elvis_lhs) + ', message=' + this.l3k_1 + ')';
|
|
311
|
+
};
|
|
312
|
+
protoOf(CloseReason).hashCode = function () {
|
|
313
|
+
var result = this.k3k_1;
|
|
314
|
+
result = imul(result, 31) + getStringHashCode(this.l3k_1) | 0;
|
|
315
|
+
return result;
|
|
316
|
+
};
|
|
317
|
+
protoOf(CloseReason).equals = function (other) {
|
|
318
|
+
if (this === other)
|
|
319
|
+
return true;
|
|
320
|
+
if (!(other instanceof CloseReason))
|
|
321
|
+
return false;
|
|
322
|
+
if (!(this.k3k_1 === other.k3k_1))
|
|
323
|
+
return false;
|
|
324
|
+
if (!(this.l3k_1 === other.l3k_1))
|
|
325
|
+
return false;
|
|
326
|
+
return true;
|
|
327
|
+
};
|
|
328
|
+
function utf8Size(_this__u8e3s4) {
|
|
329
|
+
var size = 0;
|
|
330
|
+
var index = 0;
|
|
331
|
+
while (index < _this__u8e3s4.length) {
|
|
332
|
+
var bytes = utf8ByteCountAt(_this__u8e3s4, index);
|
|
333
|
+
size = size + bytes | 0;
|
|
334
|
+
index = index + (bytes === 4 ? 2 : 1) | 0;
|
|
335
|
+
}
|
|
336
|
+
return size;
|
|
337
|
+
}
|
|
338
|
+
function utf8Truncate(_this__u8e3s4, maxSize) {
|
|
339
|
+
var size = 0;
|
|
340
|
+
var index = 0;
|
|
341
|
+
$l$loop: while (index < _this__u8e3s4.length) {
|
|
342
|
+
var bytes = utf8ByteCountAt(_this__u8e3s4, index);
|
|
343
|
+
if ((size + bytes | 0) > maxSize)
|
|
344
|
+
break $l$loop;
|
|
345
|
+
size = size + bytes | 0;
|
|
346
|
+
index = index + (bytes === 4 ? 2 : 1) | 0;
|
|
347
|
+
}
|
|
348
|
+
return index === _this__u8e3s4.length ? _this__u8e3s4 : substring(_this__u8e3s4, 0, index);
|
|
349
|
+
}
|
|
350
|
+
function utf8ByteCountAt(_this__u8e3s4, index) {
|
|
351
|
+
// Inline function 'kotlin.code' call
|
|
352
|
+
var this_0 = charCodeAt(_this__u8e3s4, index);
|
|
353
|
+
var code = Char__toInt_impl_vasixd(this_0);
|
|
354
|
+
return code < 128 ? 1 : code < 2048 ? 2 : isHighSurrogate(charCodeAt(_this__u8e3s4, index)) && (index + 1 | 0) < _this__u8e3s4.length && isLowSurrogate(charCodeAt(_this__u8e3s4, index + 1 | 0)) ? 4 : 3;
|
|
355
|
+
}
|
|
356
|
+
function validateSize(_this__u8e3s4) {
|
|
357
|
+
// Inline function 'kotlin.require' call
|
|
358
|
+
if (!(!_this__u8e3s4.s3k_1.p3k_1 || _this__u8e3s4.t3k_1.length <= 125)) {
|
|
359
|
+
var message = 'Control frames must not exceed 125 bytes per RFC 6455, ' + ('but ' + _this__u8e3s4.s3k_1.toString() + ' frame has ' + _this__u8e3s4.t3k_1.length + ' bytes');
|
|
360
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
function get_LOGGER() {
|
|
364
|
+
_init_properties_DefaultWebSocketSession_kt__469s0y();
|
|
365
|
+
return LOGGER;
|
|
366
|
+
}
|
|
367
|
+
var LOGGER;
|
|
368
|
+
function get_IncomingProcessorCoroutineName() {
|
|
369
|
+
_init_properties_DefaultWebSocketSession_kt__469s0y();
|
|
370
|
+
return IncomingProcessorCoroutineName;
|
|
371
|
+
}
|
|
372
|
+
var IncomingProcessorCoroutineName;
|
|
373
|
+
function get_OutgoingProcessorCoroutineName() {
|
|
374
|
+
_init_properties_DefaultWebSocketSession_kt__469s0y();
|
|
375
|
+
return OutgoingProcessorCoroutineName;
|
|
376
|
+
}
|
|
377
|
+
var OutgoingProcessorCoroutineName;
|
|
378
|
+
function get_NORMAL_CLOSE() {
|
|
379
|
+
_init_properties_DefaultWebSocketSession_kt__469s0y();
|
|
380
|
+
return NORMAL_CLOSE;
|
|
381
|
+
}
|
|
382
|
+
var NORMAL_CLOSE;
|
|
383
|
+
var OUTGOING_CHANNEL_CONFIG;
|
|
384
|
+
function DefaultWebSocketSession() {
|
|
385
|
+
}
|
|
386
|
+
function DefaultWebSocketSession_0(session, pingIntervalMillis, timeoutMillis, channelsConfig) {
|
|
387
|
+
pingIntervalMillis = pingIntervalMillis === VOID ? new Long(0, 0) : pingIntervalMillis;
|
|
388
|
+
timeoutMillis = timeoutMillis === VOID ? new Long(15000, 0) : timeoutMillis;
|
|
389
|
+
channelsConfig = channelsConfig === VOID ? Companion_getInstance_3().e3l_1 : channelsConfig;
|
|
390
|
+
_init_properties_DefaultWebSocketSession_kt__469s0y();
|
|
391
|
+
// Inline function 'kotlin.require' call
|
|
392
|
+
if (!!isInterface(session, DefaultWebSocketSession)) {
|
|
393
|
+
var message = 'Cannot wrap other DefaultWebSocketSession';
|
|
394
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
395
|
+
}
|
|
396
|
+
return new DefaultWebSocketSessionImpl(session, pingIntervalMillis, timeoutMillis, channelsConfig.f3l_1, channelsConfig.g3l_1);
|
|
397
|
+
}
|
|
398
|
+
function runIncomingProcessor($this, ponger) {
|
|
399
|
+
var tmp = get_IncomingProcessorCoroutineName().gj(Dispatchers_getInstance().z18_1);
|
|
400
|
+
return launch($this, tmp, VOID, DefaultWebSocketSessionImpl$runIncomingProcessor$slambda_0($this, ponger, null));
|
|
401
|
+
}
|
|
402
|
+
function runOutgoingProcessor($this) {
|
|
403
|
+
var tmp = get_OutgoingProcessorCoroutineName().gj(Dispatchers_getInstance().z18_1);
|
|
404
|
+
var tmp_0 = CoroutineStart_UNDISPATCHED_getInstance();
|
|
405
|
+
return launch($this, tmp, tmp_0, DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda_0($this, null));
|
|
406
|
+
}
|
|
407
|
+
function outgoingProcessorLoop($this, $completion) {
|
|
408
|
+
var tmp = new $outgoingProcessorLoopCOROUTINE$($this, $completion);
|
|
409
|
+
tmp.i9_1 = Unit_instance;
|
|
410
|
+
tmp.j9_1 = null;
|
|
411
|
+
return tmp.o9();
|
|
412
|
+
}
|
|
413
|
+
function sendCloseSequence($this, reason, exception, $completion) {
|
|
414
|
+
exception = exception === VOID ? null : exception;
|
|
415
|
+
var tmp = new $sendCloseSequenceCOROUTINE$($this, reason, exception, $completion);
|
|
416
|
+
tmp.i9_1 = Unit_instance;
|
|
417
|
+
tmp.j9_1 = null;
|
|
418
|
+
return tmp.o9();
|
|
419
|
+
}
|
|
420
|
+
function tryClose($this) {
|
|
421
|
+
return $this.l3m_1.atomicfu$compareAndSet(false, true);
|
|
422
|
+
}
|
|
423
|
+
function runOrCancelPinger($this) {
|
|
424
|
+
var interval = $this.o3m_1;
|
|
425
|
+
var tmp;
|
|
426
|
+
if ($this.l3m_1.kotlinx$atomicfu$value) {
|
|
427
|
+
tmp = null;
|
|
428
|
+
} else if (compare(interval, new Long(0, 0)) > 0) {
|
|
429
|
+
var tmp_0 = $this.e3m_1.c3l();
|
|
430
|
+
var tmp_1 = $this.p3m_1;
|
|
431
|
+
tmp = pinger($this, tmp_0, interval, tmp_1, DefaultWebSocketSessionImpl$runOrCancelPinger$slambda_0($this, null));
|
|
432
|
+
} else {
|
|
433
|
+
tmp = null;
|
|
434
|
+
}
|
|
435
|
+
var newPinger = tmp;
|
|
436
|
+
var tmp0_safe_receiver = $this.f3m_1.atomicfu$getAndSet(newPinger);
|
|
437
|
+
if (tmp0_safe_receiver == null)
|
|
438
|
+
null;
|
|
439
|
+
else
|
|
440
|
+
tmp0_safe_receiver.n1f();
|
|
441
|
+
var tmp2_safe_receiver = newPinger == null ? null : new ChannelResult(newPinger.h1f(Companion_getInstance_1().r3m_1));
|
|
442
|
+
if (tmp2_safe_receiver == null)
|
|
443
|
+
null;
|
|
444
|
+
else
|
|
445
|
+
_ChannelResult___get_isSuccess__impl__odq1z9(tmp2_safe_receiver.r1d_1);
|
|
446
|
+
if ($this.l3m_1.kotlinx$atomicfu$value && !(newPinger == null)) {
|
|
447
|
+
runOrCancelPinger($this);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
function checkMaxFrameSize($this, packet, frame, $completion) {
|
|
451
|
+
var tmp = new $checkMaxFrameSizeCOROUTINE$($this, packet, frame, $completion);
|
|
452
|
+
tmp.i9_1 = Unit_instance;
|
|
453
|
+
tmp.j9_1 = null;
|
|
454
|
+
return tmp.o9();
|
|
455
|
+
}
|
|
456
|
+
function processIncomingExtensions($this, frame) {
|
|
457
|
+
// Inline function 'kotlin.collections.fold' call
|
|
458
|
+
var accumulator = frame;
|
|
459
|
+
var _iterator__ex2g4s = $this.e3n().t();
|
|
460
|
+
while (_iterator__ex2g4s.u()) {
|
|
461
|
+
var element = _iterator__ex2g4s.v();
|
|
462
|
+
var current = accumulator;
|
|
463
|
+
accumulator = element.f3n(current);
|
|
464
|
+
}
|
|
465
|
+
return accumulator;
|
|
466
|
+
}
|
|
467
|
+
function processOutgoingExtensions($this, frame) {
|
|
468
|
+
// Inline function 'kotlin.collections.fold' call
|
|
469
|
+
var accumulator = frame;
|
|
470
|
+
var _iterator__ex2g4s = $this.e3n().t();
|
|
471
|
+
while (_iterator__ex2g4s.u()) {
|
|
472
|
+
var element = _iterator__ex2g4s.v();
|
|
473
|
+
var current = accumulator;
|
|
474
|
+
accumulator = element.g3n(current);
|
|
475
|
+
}
|
|
476
|
+
return accumulator;
|
|
477
|
+
}
|
|
478
|
+
function Companion_1() {
|
|
479
|
+
Companion_instance_1 = this;
|
|
480
|
+
this.r3m_1 = new Pong(new Int8Array(0), NonDisposableHandle_instance);
|
|
481
|
+
}
|
|
482
|
+
var Companion_instance_1;
|
|
483
|
+
function Companion_getInstance_1() {
|
|
484
|
+
if (Companion_instance_1 == null)
|
|
485
|
+
new Companion_1();
|
|
486
|
+
return Companion_instance_1;
|
|
487
|
+
}
|
|
488
|
+
function DefaultWebSocketSessionImpl$start$slambda($incomingJob, $outgoingJob, this$0, resultContinuation) {
|
|
489
|
+
this.p3n_1 = $incomingJob;
|
|
490
|
+
this.q3n_1 = $outgoingJob;
|
|
491
|
+
this.r3n_1 = this$0;
|
|
492
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
493
|
+
}
|
|
494
|
+
protoOf(DefaultWebSocketSessionImpl$start$slambda).k1n = function ($this$launch, $completion) {
|
|
495
|
+
var tmp = this.l1n($this$launch, $completion);
|
|
496
|
+
tmp.i9_1 = Unit_instance;
|
|
497
|
+
tmp.j9_1 = null;
|
|
498
|
+
return tmp.o9();
|
|
499
|
+
};
|
|
500
|
+
protoOf(DefaultWebSocketSessionImpl$start$slambda).ba = function (p1, $completion) {
|
|
501
|
+
return this.k1n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
502
|
+
};
|
|
503
|
+
protoOf(DefaultWebSocketSessionImpl$start$slambda).o9 = function () {
|
|
504
|
+
var suspendResult = this.i9_1;
|
|
505
|
+
$sm: do
|
|
506
|
+
try {
|
|
507
|
+
var tmp = this.g9_1;
|
|
508
|
+
switch (tmp) {
|
|
509
|
+
case 0:
|
|
510
|
+
this.h9_1 = 3;
|
|
511
|
+
this.g9_1 = 1;
|
|
512
|
+
suspendResult = this.p3n_1.ox(this);
|
|
513
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
514
|
+
return suspendResult;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
continue $sm;
|
|
518
|
+
case 1:
|
|
519
|
+
this.g9_1 = 2;
|
|
520
|
+
suspendResult = this.q3n_1.ox(this);
|
|
521
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
522
|
+
return suspendResult;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
continue $sm;
|
|
526
|
+
case 2:
|
|
527
|
+
this.r3n_1.h3m_1.sx();
|
|
528
|
+
return Unit_instance;
|
|
529
|
+
case 3:
|
|
530
|
+
throw this.j9_1;
|
|
531
|
+
}
|
|
532
|
+
} catch ($p) {
|
|
533
|
+
var e = $p;
|
|
534
|
+
if (this.h9_1 === 3) {
|
|
535
|
+
throw e;
|
|
536
|
+
} else {
|
|
537
|
+
this.g9_1 = this.h9_1;
|
|
538
|
+
this.j9_1 = e;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
while (true);
|
|
542
|
+
};
|
|
543
|
+
protoOf(DefaultWebSocketSessionImpl$start$slambda).l1n = function ($this$launch, completion) {
|
|
544
|
+
var i = new DefaultWebSocketSessionImpl$start$slambda(this.p3n_1, this.q3n_1, this.r3n_1, completion);
|
|
545
|
+
i.s3n_1 = $this$launch;
|
|
546
|
+
return i;
|
|
547
|
+
};
|
|
548
|
+
function DefaultWebSocketSessionImpl$start$slambda_0($incomingJob, $outgoingJob, this$0, resultContinuation) {
|
|
549
|
+
var i = new DefaultWebSocketSessionImpl$start$slambda($incomingJob, $outgoingJob, this$0, resultContinuation);
|
|
550
|
+
return constructCallableReference(function ($this$launch, $completion) {
|
|
551
|
+
return i.k1n($this$launch, $completion);
|
|
552
|
+
}, 1);
|
|
553
|
+
}
|
|
554
|
+
function DefaultWebSocketSessionImpl$runIncomingProcessor$slambda(this$0, $ponger, resultContinuation) {
|
|
555
|
+
this.b3o_1 = this$0;
|
|
556
|
+
this.c3o_1 = $ponger;
|
|
557
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
558
|
+
}
|
|
559
|
+
protoOf(DefaultWebSocketSessionImpl$runIncomingProcessor$slambda).k1n = function ($this$launch, $completion) {
|
|
560
|
+
var tmp = this.l1n($this$launch, $completion);
|
|
561
|
+
tmp.i9_1 = Unit_instance;
|
|
562
|
+
tmp.j9_1 = null;
|
|
563
|
+
return tmp.o9();
|
|
564
|
+
};
|
|
565
|
+
protoOf(DefaultWebSocketSessionImpl$runIncomingProcessor$slambda).ba = function (p1, $completion) {
|
|
566
|
+
return this.k1n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
567
|
+
};
|
|
568
|
+
protoOf(DefaultWebSocketSessionImpl$runIncomingProcessor$slambda).o9 = function () {
|
|
569
|
+
var suspendResult = this.i9_1;
|
|
570
|
+
$sm: do
|
|
571
|
+
try {
|
|
572
|
+
var tmp = this.g9_1;
|
|
573
|
+
switch (tmp) {
|
|
574
|
+
case 0:
|
|
575
|
+
this.h9_1 = 39;
|
|
576
|
+
this.n3o_1 = null;
|
|
577
|
+
this.g3o_1 = null;
|
|
578
|
+
this.f3o_1 = false;
|
|
579
|
+
this.h3o_1 = Unit_instance;
|
|
580
|
+
this.g9_1 = 1;
|
|
581
|
+
continue $sm;
|
|
582
|
+
case 1:
|
|
583
|
+
this.g9_1 = 2;
|
|
584
|
+
continue $sm;
|
|
585
|
+
case 2:
|
|
586
|
+
this.h9_1 = 33;
|
|
587
|
+
this.h9_1 = 32;
|
|
588
|
+
this.r3o_1 = this.b3o_1.e3m_1.b3l();
|
|
589
|
+
this.g9_1 = 3;
|
|
590
|
+
continue $sm;
|
|
591
|
+
case 3:
|
|
592
|
+
this.k3o_1 = this.r3o_1;
|
|
593
|
+
this.j3o_1 = null;
|
|
594
|
+
this.g9_1 = 4;
|
|
595
|
+
continue $sm;
|
|
596
|
+
case 4:
|
|
597
|
+
this.g9_1 = 5;
|
|
598
|
+
continue $sm;
|
|
599
|
+
case 5:
|
|
600
|
+
this.g9_1 = 6;
|
|
601
|
+
continue $sm;
|
|
602
|
+
case 6:
|
|
603
|
+
this.h9_1 = 29;
|
|
604
|
+
this.h9_1 = 28;
|
|
605
|
+
this.q3o_1 = this.k3o_1.t();
|
|
606
|
+
this.g9_1 = 7;
|
|
607
|
+
continue $sm;
|
|
608
|
+
case 7:
|
|
609
|
+
this.g9_1 = 8;
|
|
610
|
+
suspendResult = this.q3o_1.j1d(this);
|
|
611
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
612
|
+
return suspendResult;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
continue $sm;
|
|
616
|
+
case 8:
|
|
617
|
+
if (!suspendResult) {
|
|
618
|
+
this.g9_1 = 26;
|
|
619
|
+
continue $sm;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
var e = this.q3o_1.v();
|
|
623
|
+
this.p3o_1 = e;
|
|
624
|
+
this.g9_1 = 9;
|
|
625
|
+
continue $sm;
|
|
626
|
+
case 9:
|
|
627
|
+
this.o3o_1 = this.p3o_1;
|
|
628
|
+
var this_0 = get_LOGGER();
|
|
629
|
+
if (get_isTraceEnabled(this_0)) {
|
|
630
|
+
this_0.q30('WebSocketSession(' + toString(this.d3o_1) + ') receiving frame ' + this.o3o_1.toString());
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
var tmp0_subject = this.o3o_1;
|
|
634
|
+
if (tmp0_subject instanceof Close) {
|
|
635
|
+
if (!this.b3o_1.c3l().l1d()) {
|
|
636
|
+
this.g9_1 = 18;
|
|
637
|
+
var tmp_0 = this.b3o_1.c3l();
|
|
638
|
+
var tmp1_elvis_lhs = readReason(this.o3o_1);
|
|
639
|
+
suspendResult = tmp_0.g1f(Close_init_$Create$(tmp1_elvis_lhs == null ? get_NORMAL_CLOSE() : tmp1_elvis_lhs), this);
|
|
640
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
641
|
+
return suspendResult;
|
|
642
|
+
}
|
|
643
|
+
continue $sm;
|
|
644
|
+
} else {
|
|
645
|
+
this.g9_1 = 19;
|
|
646
|
+
continue $sm;
|
|
647
|
+
}
|
|
648
|
+
} else {
|
|
649
|
+
if (tmp0_subject instanceof Pong) {
|
|
650
|
+
var tmp2_safe_receiver = this.b3o_1.f3m_1.kotlinx$atomicfu$value;
|
|
651
|
+
if (tmp2_safe_receiver == null) {
|
|
652
|
+
this.m3o_1 = null;
|
|
653
|
+
this.g9_1 = 17;
|
|
654
|
+
continue $sm;
|
|
655
|
+
} else {
|
|
656
|
+
this.g9_1 = 16;
|
|
657
|
+
suspendResult = tmp2_safe_receiver.g1f(this.o3o_1, this);
|
|
658
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
659
|
+
return suspendResult;
|
|
660
|
+
}
|
|
661
|
+
continue $sm;
|
|
662
|
+
}
|
|
663
|
+
} else {
|
|
664
|
+
if (tmp0_subject instanceof Ping) {
|
|
665
|
+
this.g9_1 = 15;
|
|
666
|
+
suspendResult = this.c3o_1.g1f(this.o3o_1, this);
|
|
667
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
668
|
+
return suspendResult;
|
|
669
|
+
}
|
|
670
|
+
continue $sm;
|
|
671
|
+
} else {
|
|
672
|
+
this.g9_1 = 10;
|
|
673
|
+
suspendResult = checkMaxFrameSize(this.b3o_1, this.g3o_1, this.o3o_1, this);
|
|
674
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
675
|
+
return suspendResult;
|
|
676
|
+
}
|
|
677
|
+
continue $sm;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
case 10:
|
|
683
|
+
if (!this.o3o_1.r3k_1) {
|
|
684
|
+
if (this.n3o_1 == null) {
|
|
685
|
+
this.n3o_1 = this.o3o_1;
|
|
686
|
+
}
|
|
687
|
+
if (this.g3o_1 == null) {
|
|
688
|
+
this.g3o_1 = BytePacketBuilder();
|
|
689
|
+
}
|
|
690
|
+
writeFully(this.g3o_1, this.o3o_1.t3k_1);
|
|
691
|
+
this.g9_1 = 21;
|
|
692
|
+
continue $sm;
|
|
693
|
+
} else {
|
|
694
|
+
this.g9_1 = 11;
|
|
695
|
+
continue $sm;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
case 11:
|
|
699
|
+
if (this.n3o_1 == null) {
|
|
700
|
+
this.g9_1 = 14;
|
|
701
|
+
suspendResult = this.b3o_1.j3m_1.g1f(processIncomingExtensions(this.b3o_1, this.o3o_1), this);
|
|
702
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
703
|
+
return suspendResult;
|
|
704
|
+
}
|
|
705
|
+
continue $sm;
|
|
706
|
+
} else {
|
|
707
|
+
this.g9_1 = 12;
|
|
708
|
+
continue $sm;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
case 12:
|
|
712
|
+
writeFully(ensureNotNull(this.g3o_1), this.o3o_1.t3k_1);
|
|
713
|
+
var defragmented = Companion_getInstance_6().t3o(true, this.n3o_1.s3k_1, readByteArray(build(this.g3o_1)), this.n3o_1.v3k_1, this.n3o_1.w3k_1, this.n3o_1.x3k_1);
|
|
714
|
+
this.n3o_1 = null;
|
|
715
|
+
this.g9_1 = 13;
|
|
716
|
+
suspendResult = this.b3o_1.j3m_1.g1f(processIncomingExtensions(this.b3o_1, defragmented), this);
|
|
717
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
718
|
+
return suspendResult;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
continue $sm;
|
|
722
|
+
case 13:
|
|
723
|
+
var tmp_1 = this;
|
|
724
|
+
tmp_1.l3o_1 = Unit_instance;
|
|
725
|
+
this.g9_1 = 20;
|
|
726
|
+
continue $sm;
|
|
727
|
+
case 14:
|
|
728
|
+
this.g9_1 = 21;
|
|
729
|
+
continue $sm;
|
|
730
|
+
case 15:
|
|
731
|
+
var tmp_2 = this;
|
|
732
|
+
tmp_2.l3o_1 = Unit_instance;
|
|
733
|
+
this.g9_1 = 20;
|
|
734
|
+
continue $sm;
|
|
735
|
+
case 16:
|
|
736
|
+
var tmp_3 = this;
|
|
737
|
+
tmp_3.m3o_1 = Unit_instance;
|
|
738
|
+
this.g9_1 = 17;
|
|
739
|
+
continue $sm;
|
|
740
|
+
case 17:
|
|
741
|
+
this.l3o_1 = this.m3o_1;
|
|
742
|
+
this.g9_1 = 20;
|
|
743
|
+
continue $sm;
|
|
744
|
+
case 18:
|
|
745
|
+
this.g9_1 = 19;
|
|
746
|
+
continue $sm;
|
|
747
|
+
case 19:
|
|
748
|
+
this.f3o_1 = true;
|
|
749
|
+
this.g9_1 = 22;
|
|
750
|
+
var tmp_4 = this;
|
|
751
|
+
continue $sm;
|
|
752
|
+
case 20:
|
|
753
|
+
if (false) {
|
|
754
|
+
this.g9_1 = 9;
|
|
755
|
+
continue $sm;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
this.g9_1 = 21;
|
|
759
|
+
continue $sm;
|
|
760
|
+
case 21:
|
|
761
|
+
this.g9_1 = 7;
|
|
762
|
+
continue $sm;
|
|
763
|
+
case 22:
|
|
764
|
+
this.h9_1 = 32;
|
|
765
|
+
cancelConsumed(this.k3o_1, this.j3o_1);
|
|
766
|
+
this.h9_1 = 39;
|
|
767
|
+
this.g9_1 = 23;
|
|
768
|
+
continue $sm;
|
|
769
|
+
case 23:
|
|
770
|
+
this.h9_1 = 39;
|
|
771
|
+
this.c3o_1.n1f();
|
|
772
|
+
var tmp0_safe_receiver = this.g3o_1;
|
|
773
|
+
if (tmp0_safe_receiver == null)
|
|
774
|
+
null;
|
|
775
|
+
else {
|
|
776
|
+
tmp0_safe_receiver.h4();
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
this.b3o_1.j3m_1.n1f();
|
|
780
|
+
if (!this.f3o_1) {
|
|
781
|
+
this.g9_1 = 24;
|
|
782
|
+
suspendResult = close(this.b3o_1, CloseReason_init_$Create$(Codes_CLOSED_ABNORMALLY_getInstance(), 'Connection was closed without close frame'), this);
|
|
783
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
784
|
+
return suspendResult;
|
|
785
|
+
}
|
|
786
|
+
continue $sm;
|
|
787
|
+
} else {
|
|
788
|
+
this.g9_1 = 25;
|
|
789
|
+
continue $sm;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
case 24:
|
|
793
|
+
this.g9_1 = 25;
|
|
794
|
+
continue $sm;
|
|
795
|
+
case 25:
|
|
796
|
+
var tmp_5 = this;
|
|
797
|
+
return Unit_instance;
|
|
798
|
+
case 26:
|
|
799
|
+
this.g9_1 = 27;
|
|
800
|
+
var tmp_6 = this;
|
|
801
|
+
continue $sm;
|
|
802
|
+
case 27:
|
|
803
|
+
this.h9_1 = 32;
|
|
804
|
+
cancelConsumed(this.k3o_1, this.j3o_1);
|
|
805
|
+
this.g9_1 = 31;
|
|
806
|
+
continue $sm;
|
|
807
|
+
case 28:
|
|
808
|
+
this.h9_1 = 29;
|
|
809
|
+
var tmp_7 = this.j9_1;
|
|
810
|
+
if (tmp_7 instanceof Error) {
|
|
811
|
+
var e_0 = this.j9_1;
|
|
812
|
+
var tmp_8 = this;
|
|
813
|
+
this.j3o_1 = e_0;
|
|
814
|
+
throw e_0;
|
|
815
|
+
} else {
|
|
816
|
+
throw this.j9_1;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
case 29:
|
|
820
|
+
this.h9_1 = 32;
|
|
821
|
+
var t = this.j9_1;
|
|
822
|
+
cancelConsumed(this.k3o_1, this.j3o_1);
|
|
823
|
+
throw t;
|
|
824
|
+
case 30:
|
|
825
|
+
this.h9_1 = 32;
|
|
826
|
+
cancelConsumed(this.k3o_1, this.j3o_1);
|
|
827
|
+
if (false) {
|
|
828
|
+
this.g9_1 = 3;
|
|
829
|
+
continue $sm;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
this.g9_1 = 31;
|
|
833
|
+
continue $sm;
|
|
834
|
+
case 31:
|
|
835
|
+
this.h3o_1 = Unit_instance;
|
|
836
|
+
this.h9_1 = 39;
|
|
837
|
+
this.g9_1 = 36;
|
|
838
|
+
continue $sm;
|
|
839
|
+
case 32:
|
|
840
|
+
this.h9_1 = 33;
|
|
841
|
+
var tmp_9 = this.j9_1;
|
|
842
|
+
if (tmp_9 instanceof ClosedSendChannelException) {
|
|
843
|
+
var _unused_var__etf5q3 = this.j9_1;
|
|
844
|
+
var tmp_10 = this;
|
|
845
|
+
tmp_10.h3o_1 = Unit_instance;
|
|
846
|
+
this.h9_1 = 39;
|
|
847
|
+
this.g9_1 = 36;
|
|
848
|
+
continue $sm;
|
|
849
|
+
} else {
|
|
850
|
+
var tmp_11 = this.j9_1;
|
|
851
|
+
if (tmp_11 instanceof Error) {
|
|
852
|
+
var cause = this.j9_1;
|
|
853
|
+
var tmp_12 = this;
|
|
854
|
+
this.c3o_1.n1f();
|
|
855
|
+
tmp_12.h3o_1 = this.b3o_1.j3m_1.l1f(cause);
|
|
856
|
+
this.h9_1 = 39;
|
|
857
|
+
this.g9_1 = 36;
|
|
858
|
+
continue $sm;
|
|
859
|
+
} else {
|
|
860
|
+
throw this.j9_1;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
case 33:
|
|
865
|
+
this.h9_1 = 39;
|
|
866
|
+
this.i3o_1 = this.j9_1;
|
|
867
|
+
this.c3o_1.n1f();
|
|
868
|
+
var tmp0_safe_receiver_0 = this.g3o_1;
|
|
869
|
+
if (tmp0_safe_receiver_0 == null)
|
|
870
|
+
null;
|
|
871
|
+
else {
|
|
872
|
+
tmp0_safe_receiver_0.h4();
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
this.b3o_1.j3m_1.n1f();
|
|
876
|
+
if (!this.f3o_1) {
|
|
877
|
+
this.g9_1 = 34;
|
|
878
|
+
suspendResult = close(this.b3o_1, CloseReason_init_$Create$(Codes_CLOSED_ABNORMALLY_getInstance(), 'Connection was closed without close frame'), this);
|
|
879
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
880
|
+
return suspendResult;
|
|
881
|
+
}
|
|
882
|
+
continue $sm;
|
|
883
|
+
} else {
|
|
884
|
+
this.g9_1 = 35;
|
|
885
|
+
continue $sm;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
case 34:
|
|
889
|
+
this.g9_1 = 35;
|
|
890
|
+
continue $sm;
|
|
891
|
+
case 35:
|
|
892
|
+
throw this.i3o_1;
|
|
893
|
+
case 36:
|
|
894
|
+
this.e3o_1 = this.h3o_1;
|
|
895
|
+
this.h9_1 = 39;
|
|
896
|
+
this.c3o_1.n1f();
|
|
897
|
+
var tmp0_safe_receiver_1 = this.g3o_1;
|
|
898
|
+
if (tmp0_safe_receiver_1 == null)
|
|
899
|
+
null;
|
|
900
|
+
else {
|
|
901
|
+
tmp0_safe_receiver_1.h4();
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
this.b3o_1.j3m_1.n1f();
|
|
905
|
+
if (!this.f3o_1) {
|
|
906
|
+
this.g9_1 = 37;
|
|
907
|
+
suspendResult = close(this.b3o_1, CloseReason_init_$Create$(Codes_CLOSED_ABNORMALLY_getInstance(), 'Connection was closed without close frame'), this);
|
|
908
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
909
|
+
return suspendResult;
|
|
910
|
+
}
|
|
911
|
+
continue $sm;
|
|
912
|
+
} else {
|
|
913
|
+
this.g9_1 = 38;
|
|
914
|
+
continue $sm;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
case 37:
|
|
918
|
+
this.g9_1 = 38;
|
|
919
|
+
continue $sm;
|
|
920
|
+
case 38:
|
|
921
|
+
return Unit_instance;
|
|
922
|
+
case 39:
|
|
923
|
+
throw this.j9_1;
|
|
924
|
+
}
|
|
925
|
+
} catch ($p) {
|
|
926
|
+
var e_1 = $p;
|
|
927
|
+
if (this.h9_1 === 39) {
|
|
928
|
+
throw e_1;
|
|
929
|
+
} else {
|
|
930
|
+
this.g9_1 = this.h9_1;
|
|
931
|
+
this.j9_1 = e_1;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
while (true);
|
|
935
|
+
};
|
|
936
|
+
protoOf(DefaultWebSocketSessionImpl$runIncomingProcessor$slambda).l1n = function ($this$launch, completion) {
|
|
937
|
+
var i = new DefaultWebSocketSessionImpl$runIncomingProcessor$slambda(this.b3o_1, this.c3o_1, completion);
|
|
938
|
+
i.d3o_1 = $this$launch;
|
|
939
|
+
return i;
|
|
940
|
+
};
|
|
941
|
+
function DefaultWebSocketSessionImpl$runIncomingProcessor$slambda_0(this$0, $ponger, resultContinuation) {
|
|
942
|
+
var i = new DefaultWebSocketSessionImpl$runIncomingProcessor$slambda(this$0, $ponger, resultContinuation);
|
|
943
|
+
return constructCallableReference(function ($this$launch, $completion) {
|
|
944
|
+
return i.k1n($this$launch, $completion);
|
|
945
|
+
}, 1);
|
|
946
|
+
}
|
|
947
|
+
function DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda(this$0, resultContinuation) {
|
|
948
|
+
this.c3p_1 = this$0;
|
|
949
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
950
|
+
}
|
|
951
|
+
protoOf(DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda).k1n = function ($this$launch, $completion) {
|
|
952
|
+
var tmp = this.l1n($this$launch, $completion);
|
|
953
|
+
tmp.i9_1 = Unit_instance;
|
|
954
|
+
tmp.j9_1 = null;
|
|
955
|
+
return tmp.o9();
|
|
956
|
+
};
|
|
957
|
+
protoOf(DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda).ba = function (p1, $completion) {
|
|
958
|
+
return this.k1n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
959
|
+
};
|
|
960
|
+
protoOf(DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda).o9 = function () {
|
|
961
|
+
var suspendResult = this.i9_1;
|
|
962
|
+
$sm: do
|
|
963
|
+
try {
|
|
964
|
+
var tmp = this.g9_1;
|
|
965
|
+
switch (tmp) {
|
|
966
|
+
case 0:
|
|
967
|
+
this.h9_1 = 13;
|
|
968
|
+
this.g9_1 = 1;
|
|
969
|
+
continue $sm;
|
|
970
|
+
case 1:
|
|
971
|
+
this.g9_1 = 2;
|
|
972
|
+
continue $sm;
|
|
973
|
+
case 2:
|
|
974
|
+
this.h9_1 = 9;
|
|
975
|
+
this.h9_1 = 4;
|
|
976
|
+
this.g9_1 = 3;
|
|
977
|
+
suspendResult = outgoingProcessorLoop(this.c3p_1, this);
|
|
978
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
979
|
+
return suspendResult;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
continue $sm;
|
|
983
|
+
case 3:
|
|
984
|
+
this.h9_1 = 13;
|
|
985
|
+
this.g9_1 = 11;
|
|
986
|
+
continue $sm;
|
|
987
|
+
case 4:
|
|
988
|
+
this.h9_1 = 9;
|
|
989
|
+
var tmp_0 = this.j9_1;
|
|
990
|
+
if (tmp_0 instanceof ClosedSendChannelException) {
|
|
991
|
+
var _unused_var__etf5q3 = this.j9_1;
|
|
992
|
+
this.h9_1 = 13;
|
|
993
|
+
this.g9_1 = 11;
|
|
994
|
+
continue $sm;
|
|
995
|
+
} else {
|
|
996
|
+
var tmp_1 = this.j9_1;
|
|
997
|
+
if (tmp_1 instanceof ClosedReceiveChannelException) {
|
|
998
|
+
var _unused_var__etf5q3_0 = this.j9_1;
|
|
999
|
+
this.h9_1 = 13;
|
|
1000
|
+
this.g9_1 = 11;
|
|
1001
|
+
continue $sm;
|
|
1002
|
+
} else {
|
|
1003
|
+
var tmp_2 = this.j9_1;
|
|
1004
|
+
if (tmp_2 instanceof CancellationException) {
|
|
1005
|
+
var _unused_var__etf5q3_1 = this.j9_1;
|
|
1006
|
+
this.g9_1 = 5;
|
|
1007
|
+
suspendResult = sendCloseSequence(this.c3p_1, CloseReason_init_$Create$(Codes_NORMAL_getInstance(), ''), VOID, this);
|
|
1008
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1009
|
+
return suspendResult;
|
|
1010
|
+
}
|
|
1011
|
+
continue $sm;
|
|
1012
|
+
} else {
|
|
1013
|
+
var tmp_3 = this.j9_1;
|
|
1014
|
+
if (tmp_3 instanceof ChannelIOException) {
|
|
1015
|
+
var _unused_var__etf5q3_2 = this.j9_1;
|
|
1016
|
+
this.h9_1 = 13;
|
|
1017
|
+
this.g9_1 = 11;
|
|
1018
|
+
continue $sm;
|
|
1019
|
+
} else {
|
|
1020
|
+
var tmp_4 = this.j9_1;
|
|
1021
|
+
if (tmp_4 instanceof Error) {
|
|
1022
|
+
var cause = this.j9_1;
|
|
1023
|
+
this.c3p_1.k3m_1.rx(CancellationException_init_$Create$('Failed to send frame', cause));
|
|
1024
|
+
this.g9_1 = 6;
|
|
1025
|
+
suspendResult = closeExceptionally(this.c3p_1.e3m_1, cause, this);
|
|
1026
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1027
|
+
return suspendResult;
|
|
1028
|
+
}
|
|
1029
|
+
continue $sm;
|
|
1030
|
+
} else {
|
|
1031
|
+
throw this.j9_1;
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
case 5:
|
|
1039
|
+
this.h9_1 = 13;
|
|
1040
|
+
this.g9_1 = 11;
|
|
1041
|
+
continue $sm;
|
|
1042
|
+
case 6:
|
|
1043
|
+
this.h9_1 = 13;
|
|
1044
|
+
this.g9_1 = 7;
|
|
1045
|
+
continue $sm;
|
|
1046
|
+
case 7:
|
|
1047
|
+
this.h9_1 = 13;
|
|
1048
|
+
this.c3p_1.k3m_1.p1f();
|
|
1049
|
+
this.g9_1 = 8;
|
|
1050
|
+
suspendResult = close(this.c3p_1.e3m_1, VOID, this);
|
|
1051
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1052
|
+
return suspendResult;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
continue $sm;
|
|
1056
|
+
case 8:
|
|
1057
|
+
return Unit_instance;
|
|
1058
|
+
case 9:
|
|
1059
|
+
this.h9_1 = 13;
|
|
1060
|
+
this.e3p_1 = this.j9_1;
|
|
1061
|
+
this.c3p_1.k3m_1.p1f();
|
|
1062
|
+
this.g9_1 = 10;
|
|
1063
|
+
suspendResult = close(this.c3p_1.e3m_1, VOID, this);
|
|
1064
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1065
|
+
return suspendResult;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
continue $sm;
|
|
1069
|
+
case 10:
|
|
1070
|
+
throw this.e3p_1;
|
|
1071
|
+
case 11:
|
|
1072
|
+
this.h9_1 = 13;
|
|
1073
|
+
this.c3p_1.k3m_1.p1f();
|
|
1074
|
+
this.g9_1 = 12;
|
|
1075
|
+
suspendResult = close(this.c3p_1.e3m_1, VOID, this);
|
|
1076
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1077
|
+
return suspendResult;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
continue $sm;
|
|
1081
|
+
case 12:
|
|
1082
|
+
return Unit_instance;
|
|
1083
|
+
case 13:
|
|
1084
|
+
throw this.j9_1;
|
|
1085
|
+
}
|
|
1086
|
+
} catch ($p) {
|
|
1087
|
+
var e = $p;
|
|
1088
|
+
if (this.h9_1 === 13) {
|
|
1089
|
+
throw e;
|
|
1090
|
+
} else {
|
|
1091
|
+
this.g9_1 = this.h9_1;
|
|
1092
|
+
this.j9_1 = e;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
while (true);
|
|
1096
|
+
};
|
|
1097
|
+
protoOf(DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda).l1n = function ($this$launch, completion) {
|
|
1098
|
+
var i = new DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda(this.c3p_1, completion);
|
|
1099
|
+
i.d3p_1 = $this$launch;
|
|
1100
|
+
return i;
|
|
1101
|
+
};
|
|
1102
|
+
function DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda_0(this$0, resultContinuation) {
|
|
1103
|
+
var i = new DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda(this$0, resultContinuation);
|
|
1104
|
+
return constructCallableReference(function ($this$launch, $completion) {
|
|
1105
|
+
return i.k1n($this$launch, $completion);
|
|
1106
|
+
}, 1);
|
|
1107
|
+
}
|
|
1108
|
+
function DefaultWebSocketSessionImpl$runOrCancelPinger$slambda(this$0, resultContinuation) {
|
|
1109
|
+
this.n3p_1 = this$0;
|
|
1110
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1111
|
+
}
|
|
1112
|
+
protoOf(DefaultWebSocketSessionImpl$runOrCancelPinger$slambda).p3p = function (it, $completion) {
|
|
1113
|
+
var tmp = this.q3p(it, $completion);
|
|
1114
|
+
tmp.i9_1 = Unit_instance;
|
|
1115
|
+
tmp.j9_1 = null;
|
|
1116
|
+
return tmp.o9();
|
|
1117
|
+
};
|
|
1118
|
+
protoOf(DefaultWebSocketSessionImpl$runOrCancelPinger$slambda).ba = function (p1, $completion) {
|
|
1119
|
+
return this.p3p(p1 instanceof CloseReason ? p1 : THROW_CCE(), $completion);
|
|
1120
|
+
};
|
|
1121
|
+
protoOf(DefaultWebSocketSessionImpl$runOrCancelPinger$slambda).o9 = function () {
|
|
1122
|
+
var suspendResult = this.i9_1;
|
|
1123
|
+
$sm: do
|
|
1124
|
+
try {
|
|
1125
|
+
var tmp = this.g9_1;
|
|
1126
|
+
switch (tmp) {
|
|
1127
|
+
case 0:
|
|
1128
|
+
this.h9_1 = 2;
|
|
1129
|
+
this.g9_1 = 1;
|
|
1130
|
+
suspendResult = sendCloseSequence(this.n3p_1, this.o3p_1, IOException_init_$Create$('Ping timeout'), this);
|
|
1131
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1132
|
+
return suspendResult;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
continue $sm;
|
|
1136
|
+
case 1:
|
|
1137
|
+
return Unit_instance;
|
|
1138
|
+
case 2:
|
|
1139
|
+
throw this.j9_1;
|
|
1140
|
+
}
|
|
1141
|
+
} catch ($p) {
|
|
1142
|
+
var e = $p;
|
|
1143
|
+
if (this.h9_1 === 2) {
|
|
1144
|
+
throw e;
|
|
1145
|
+
} else {
|
|
1146
|
+
this.g9_1 = this.h9_1;
|
|
1147
|
+
this.j9_1 = e;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
while (true);
|
|
1151
|
+
};
|
|
1152
|
+
protoOf(DefaultWebSocketSessionImpl$runOrCancelPinger$slambda).q3p = function (it, completion) {
|
|
1153
|
+
var i = new DefaultWebSocketSessionImpl$runOrCancelPinger$slambda(this.n3p_1, completion);
|
|
1154
|
+
i.o3p_1 = it;
|
|
1155
|
+
return i;
|
|
1156
|
+
};
|
|
1157
|
+
function DefaultWebSocketSessionImpl$runOrCancelPinger$slambda_0(this$0, resultContinuation) {
|
|
1158
|
+
var i = new DefaultWebSocketSessionImpl$runOrCancelPinger$slambda(this$0, resultContinuation);
|
|
1159
|
+
return constructCallableReference(function (it, $completion) {
|
|
1160
|
+
return i.p3p(it, $completion);
|
|
1161
|
+
}, 1);
|
|
1162
|
+
}
|
|
1163
|
+
function $outgoingProcessorLoopCOROUTINE$(_this__u8e3s4, resultContinuation) {
|
|
1164
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1165
|
+
this.p3l_1 = _this__u8e3s4;
|
|
1166
|
+
}
|
|
1167
|
+
protoOf($outgoingProcessorLoopCOROUTINE$).o9 = function () {
|
|
1168
|
+
var suspendResult = this.i9_1;
|
|
1169
|
+
$sm: do
|
|
1170
|
+
try {
|
|
1171
|
+
var tmp = this.g9_1;
|
|
1172
|
+
switch (tmp) {
|
|
1173
|
+
case 0:
|
|
1174
|
+
this.h9_1 = 7;
|
|
1175
|
+
this.r3l_1 = this.p3l_1.k3m_1.t();
|
|
1176
|
+
this.g9_1 = 1;
|
|
1177
|
+
continue $sm;
|
|
1178
|
+
case 1:
|
|
1179
|
+
this.g9_1 = 2;
|
|
1180
|
+
suspendResult = this.r3l_1.j1d(this);
|
|
1181
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1182
|
+
return suspendResult;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
continue $sm;
|
|
1186
|
+
case 2:
|
|
1187
|
+
if (!suspendResult) {
|
|
1188
|
+
this.g9_1 = 6;
|
|
1189
|
+
continue $sm;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
var frame = this.r3l_1.v();
|
|
1193
|
+
var this_0 = get_LOGGER();
|
|
1194
|
+
if (get_isTraceEnabled(this_0)) {
|
|
1195
|
+
this_0.q30('Sending ' + frame.toString() + ' from session ' + toString(this.p3l_1));
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
if (frame instanceof Close) {
|
|
1199
|
+
this.g9_1 = 3;
|
|
1200
|
+
suspendResult = sendCloseSequence(this.p3l_1, readReason(frame), VOID, this);
|
|
1201
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1202
|
+
return suspendResult;
|
|
1203
|
+
}
|
|
1204
|
+
continue $sm;
|
|
1205
|
+
} else {
|
|
1206
|
+
var tmp_0;
|
|
1207
|
+
if (frame instanceof Text) {
|
|
1208
|
+
tmp_0 = true;
|
|
1209
|
+
} else {
|
|
1210
|
+
tmp_0 = frame instanceof Binary;
|
|
1211
|
+
}
|
|
1212
|
+
if (tmp_0) {
|
|
1213
|
+
this.q3l_1 = processOutgoingExtensions(this.p3l_1, frame);
|
|
1214
|
+
this.g9_1 = 4;
|
|
1215
|
+
continue $sm;
|
|
1216
|
+
} else {
|
|
1217
|
+
this.q3l_1 = frame;
|
|
1218
|
+
this.g9_1 = 4;
|
|
1219
|
+
continue $sm;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
case 3:
|
|
1224
|
+
this.g9_1 = 6;
|
|
1225
|
+
var tmp_1 = this;
|
|
1226
|
+
continue $sm;
|
|
1227
|
+
case 4:
|
|
1228
|
+
var processedFrame = this.q3l_1;
|
|
1229
|
+
this.g9_1 = 5;
|
|
1230
|
+
suspendResult = this.p3l_1.e3m_1.c3l().g1f(processedFrame, this);
|
|
1231
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1232
|
+
return suspendResult;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
continue $sm;
|
|
1236
|
+
case 5:
|
|
1237
|
+
this.g9_1 = 1;
|
|
1238
|
+
continue $sm;
|
|
1239
|
+
case 6:
|
|
1240
|
+
return Unit_instance;
|
|
1241
|
+
case 7:
|
|
1242
|
+
throw this.j9_1;
|
|
1243
|
+
}
|
|
1244
|
+
} catch ($p) {
|
|
1245
|
+
var e = $p;
|
|
1246
|
+
if (this.h9_1 === 7) {
|
|
1247
|
+
throw e;
|
|
1248
|
+
} else {
|
|
1249
|
+
this.g9_1 = this.h9_1;
|
|
1250
|
+
this.j9_1 = e;
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
while (true);
|
|
1254
|
+
};
|
|
1255
|
+
function $sendCloseSequenceCOROUTINE$(_this__u8e3s4, reason, exception, resultContinuation) {
|
|
1256
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1257
|
+
this.a3m_1 = _this__u8e3s4;
|
|
1258
|
+
this.b3m_1 = reason;
|
|
1259
|
+
this.c3m_1 = exception;
|
|
1260
|
+
}
|
|
1261
|
+
protoOf($sendCloseSequenceCOROUTINE$).o9 = function () {
|
|
1262
|
+
var suspendResult = this.i9_1;
|
|
1263
|
+
$sm: do
|
|
1264
|
+
try {
|
|
1265
|
+
var tmp = this.g9_1;
|
|
1266
|
+
switch (tmp) {
|
|
1267
|
+
case 0:
|
|
1268
|
+
this.h9_1 = 6;
|
|
1269
|
+
if (!tryClose(this.a3m_1))
|
|
1270
|
+
return Unit_instance;
|
|
1271
|
+
var this_0 = get_LOGGER();
|
|
1272
|
+
if (get_isTraceEnabled(this_0)) {
|
|
1273
|
+
this_0.q30('Sending Close Sequence for session ' + toString(this.a3m_1) + ' with reason ' + toString_0(this.b3m_1) + ' and exception ' + toString_0(this.c3m_1));
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
this.a3m_1.h3m_1.s14();
|
|
1277
|
+
var tmp_0 = this;
|
|
1278
|
+
var tmp0_elvis_lhs = this.b3m_1;
|
|
1279
|
+
tmp_0.d3m_1 = tmp0_elvis_lhs == null ? CloseReason_init_$Create$(Codes_NORMAL_getInstance(), '') : tmp0_elvis_lhs;
|
|
1280
|
+
this.g9_1 = 1;
|
|
1281
|
+
continue $sm;
|
|
1282
|
+
case 1:
|
|
1283
|
+
this.h9_1 = 5;
|
|
1284
|
+
runOrCancelPinger(this.a3m_1);
|
|
1285
|
+
if (!(this.d3m_1.k3k_1 === Codes_CLOSED_ABNORMALLY_getInstance().g3k_1)) {
|
|
1286
|
+
this.g9_1 = 2;
|
|
1287
|
+
suspendResult = this.a3m_1.e3m_1.c3l().g1f(Close_init_$Create$(this.d3m_1), this);
|
|
1288
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1289
|
+
return suspendResult;
|
|
1290
|
+
}
|
|
1291
|
+
continue $sm;
|
|
1292
|
+
} else {
|
|
1293
|
+
this.g9_1 = 3;
|
|
1294
|
+
continue $sm;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
case 2:
|
|
1298
|
+
this.g9_1 = 3;
|
|
1299
|
+
continue $sm;
|
|
1300
|
+
case 3:
|
|
1301
|
+
this.h9_1 = 6;
|
|
1302
|
+
this.g9_1 = 4;
|
|
1303
|
+
continue $sm;
|
|
1304
|
+
case 4:
|
|
1305
|
+
this.h9_1 = 6;
|
|
1306
|
+
this.a3m_1.g3m_1.q14(this.d3m_1);
|
|
1307
|
+
if (!(this.c3m_1 == null)) {
|
|
1308
|
+
this.a3m_1.k3m_1.l1f(this.c3m_1);
|
|
1309
|
+
this.a3m_1.j3m_1.l1f(this.c3m_1);
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
return Unit_instance;
|
|
1313
|
+
case 5:
|
|
1314
|
+
this.h9_1 = 6;
|
|
1315
|
+
var t = this.j9_1;
|
|
1316
|
+
this.a3m_1.g3m_1.q14(this.d3m_1);
|
|
1317
|
+
if (!(this.c3m_1 == null)) {
|
|
1318
|
+
this.a3m_1.k3m_1.l1f(this.c3m_1);
|
|
1319
|
+
this.a3m_1.j3m_1.l1f(this.c3m_1);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
throw t;
|
|
1323
|
+
case 6:
|
|
1324
|
+
throw this.j9_1;
|
|
1325
|
+
}
|
|
1326
|
+
} catch ($p) {
|
|
1327
|
+
var e = $p;
|
|
1328
|
+
if (this.h9_1 === 6) {
|
|
1329
|
+
throw e;
|
|
1330
|
+
} else {
|
|
1331
|
+
this.g9_1 = this.h9_1;
|
|
1332
|
+
this.j9_1 = e;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
while (true);
|
|
1336
|
+
};
|
|
1337
|
+
function $checkMaxFrameSizeCOROUTINE$(_this__u8e3s4, packet, frame, resultContinuation) {
|
|
1338
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1339
|
+
this.a3n_1 = _this__u8e3s4;
|
|
1340
|
+
this.b3n_1 = packet;
|
|
1341
|
+
this.c3n_1 = frame;
|
|
1342
|
+
}
|
|
1343
|
+
protoOf($checkMaxFrameSizeCOROUTINE$).o9 = function () {
|
|
1344
|
+
var suspendResult = this.i9_1;
|
|
1345
|
+
$sm: do
|
|
1346
|
+
try {
|
|
1347
|
+
var tmp = this.g9_1;
|
|
1348
|
+
switch (tmp) {
|
|
1349
|
+
case 0:
|
|
1350
|
+
this.h9_1 = 3;
|
|
1351
|
+
var tmp_0 = this;
|
|
1352
|
+
var tmp_1 = this.c3n_1.t3k_1.length;
|
|
1353
|
+
var tmp0_safe_receiver = this.b3n_1;
|
|
1354
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : get_size(tmp0_safe_receiver);
|
|
1355
|
+
tmp_0.d3n_1 = tmp_1 + (tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs) | 0;
|
|
1356
|
+
if (compare(fromInt(this.d3n_1), this.a3n_1.a3l()) > 0) {
|
|
1357
|
+
var tmp2_safe_receiver = this.b3n_1;
|
|
1358
|
+
if (tmp2_safe_receiver == null)
|
|
1359
|
+
null;
|
|
1360
|
+
else {
|
|
1361
|
+
tmp2_safe_receiver.h4();
|
|
1362
|
+
}
|
|
1363
|
+
this.g9_1 = 2;
|
|
1364
|
+
suspendResult = close(this.a3n_1, CloseReason_init_$Create$(Codes_TOO_BIG_getInstance(), 'Frame is too big: ' + this.d3n_1 + '. Max size is ' + this.a3n_1.a3l().toString()), this);
|
|
1365
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1366
|
+
return suspendResult;
|
|
1367
|
+
}
|
|
1368
|
+
continue $sm;
|
|
1369
|
+
} else {
|
|
1370
|
+
this.g9_1 = 1;
|
|
1371
|
+
continue $sm;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
case 1:
|
|
1375
|
+
return Unit_instance;
|
|
1376
|
+
case 2:
|
|
1377
|
+
throw new FrameTooBigException(fromInt(this.d3n_1));
|
|
1378
|
+
case 3:
|
|
1379
|
+
throw this.j9_1;
|
|
1380
|
+
}
|
|
1381
|
+
} catch ($p) {
|
|
1382
|
+
var e = $p;
|
|
1383
|
+
if (this.h9_1 === 3) {
|
|
1384
|
+
throw e;
|
|
1385
|
+
} else {
|
|
1386
|
+
this.g9_1 = this.h9_1;
|
|
1387
|
+
this.j9_1 = e;
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
while (true);
|
|
1391
|
+
};
|
|
1392
|
+
function DefaultWebSocketSessionImpl(raw, pingIntervalMillis, timeoutMillis, incomingFramesConfig, outgoingFramesConfig) {
|
|
1393
|
+
Companion_getInstance_1();
|
|
1394
|
+
this.e3m_1 = raw;
|
|
1395
|
+
this.f3m_1 = atomic$ref$1(null);
|
|
1396
|
+
this.g3m_1 = CompletableDeferred();
|
|
1397
|
+
this.h3m_1 = Job();
|
|
1398
|
+
this.i3m_1 = this.e3m_1.hw().ej(Key_instance).gj(this.h3m_1).gj(new CoroutineName('ws-default'));
|
|
1399
|
+
this.j3m_1 = from(Factory_getInstance(), incomingFramesConfig);
|
|
1400
|
+
this.k3m_1 = from(Factory_getInstance(), outgoingFramesConfig);
|
|
1401
|
+
this.l3m_1 = atomic$boolean$1(false);
|
|
1402
|
+
var tmp = this;
|
|
1403
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
1404
|
+
tmp.m3m_1 = ArrayList_init_$Create$();
|
|
1405
|
+
this.n3m_1 = atomic$boolean$1(false);
|
|
1406
|
+
this.o3m_1 = pingIntervalMillis;
|
|
1407
|
+
this.p3m_1 = timeoutMillis;
|
|
1408
|
+
this.q3m_1 = this.g3m_1;
|
|
1409
|
+
}
|
|
1410
|
+
protoOf(DefaultWebSocketSessionImpl).hw = function () {
|
|
1411
|
+
return this.i3m_1;
|
|
1412
|
+
};
|
|
1413
|
+
protoOf(DefaultWebSocketSessionImpl).b3l = function () {
|
|
1414
|
+
return this.j3m_1;
|
|
1415
|
+
};
|
|
1416
|
+
protoOf(DefaultWebSocketSessionImpl).c3l = function () {
|
|
1417
|
+
return this.k3m_1;
|
|
1418
|
+
};
|
|
1419
|
+
protoOf(DefaultWebSocketSessionImpl).e3n = function () {
|
|
1420
|
+
return this.m3m_1;
|
|
1421
|
+
};
|
|
1422
|
+
protoOf(DefaultWebSocketSessionImpl).z3k = function (value) {
|
|
1423
|
+
this.e3m_1.z3k(value);
|
|
1424
|
+
};
|
|
1425
|
+
protoOf(DefaultWebSocketSessionImpl).a3l = function () {
|
|
1426
|
+
return this.e3m_1.a3l();
|
|
1427
|
+
};
|
|
1428
|
+
protoOf(DefaultWebSocketSessionImpl).y3k = function (negotiatedExtensions) {
|
|
1429
|
+
if (!this.n3m_1.atomicfu$compareAndSet(false, true)) {
|
|
1430
|
+
// Inline function 'kotlin.error' call
|
|
1431
|
+
var message = 'WebSocket session ' + toString(this) + ' is already started.';
|
|
1432
|
+
throw IllegalStateException_init_$Create$(toString(message));
|
|
1433
|
+
}
|
|
1434
|
+
// Inline function 'io.ktor.util.logging.trace' call
|
|
1435
|
+
var this_0 = get_LOGGER();
|
|
1436
|
+
if (get_isTraceEnabled(this_0)) {
|
|
1437
|
+
var tmp$ret$2 = 'Starting default WebSocketSession(' + toString(this) + ') ' + ('with negotiated extensions: ' + joinToString(negotiatedExtensions));
|
|
1438
|
+
this_0.q30(tmp$ret$2);
|
|
1439
|
+
}
|
|
1440
|
+
this.m3m_1.i1(negotiatedExtensions);
|
|
1441
|
+
runOrCancelPinger(this);
|
|
1442
|
+
var incomingJob = runIncomingProcessor(this, ponger(this, this.c3l()));
|
|
1443
|
+
var outgoingJob = runOutgoingProcessor(this);
|
|
1444
|
+
launch(this, VOID, VOID, DefaultWebSocketSessionImpl$start$slambda_0(incomingJob, outgoingJob, this, null));
|
|
1445
|
+
};
|
|
1446
|
+
protoOf(DefaultWebSocketSessionImpl).w1x = function ($completion) {
|
|
1447
|
+
return this.e3m_1.w1x($completion);
|
|
1448
|
+
};
|
|
1449
|
+
var properties_initialized_DefaultWebSocketSession_kt_6cjlhc;
|
|
1450
|
+
function _init_properties_DefaultWebSocketSession_kt__469s0y() {
|
|
1451
|
+
if (!properties_initialized_DefaultWebSocketSession_kt_6cjlhc) {
|
|
1452
|
+
properties_initialized_DefaultWebSocketSession_kt_6cjlhc = true;
|
|
1453
|
+
LOGGER = KtorSimpleLogger('io.ktor.websocket.WebSocket');
|
|
1454
|
+
IncomingProcessorCoroutineName = new CoroutineName('ws-incoming-processor');
|
|
1455
|
+
OutgoingProcessorCoroutineName = new CoroutineName('ws-outgoing-processor');
|
|
1456
|
+
NORMAL_CLOSE = CloseReason_init_$Create$(Codes_NORMAL_getInstance(), 'OK');
|
|
1457
|
+
var tmp0_safe_receiver = get_OUTGOING_CHANNEL_CAPACITY();
|
|
1458
|
+
var tmp;
|
|
1459
|
+
if (tmp0_safe_receiver == null) {
|
|
1460
|
+
tmp = null;
|
|
1461
|
+
} else {
|
|
1462
|
+
// Inline function 'kotlin.let' call
|
|
1463
|
+
tmp = new ChannelConfig(tmp0_safe_receiver, ChannelOverflow_SUSPEND_getInstance());
|
|
1464
|
+
}
|
|
1465
|
+
OUTGOING_CHANNEL_CONFIG = tmp;
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
function readReason(_this__u8e3s4) {
|
|
1469
|
+
if (_this__u8e3s4.t3k_1.length < 2) {
|
|
1470
|
+
return null;
|
|
1471
|
+
}
|
|
1472
|
+
// Inline function 'io.ktor.utils.io.core.buildPacket' call
|
|
1473
|
+
var builder = new Buffer();
|
|
1474
|
+
writeFully(builder, _this__u8e3s4.t3k_1);
|
|
1475
|
+
var packet = builder;
|
|
1476
|
+
var code = packet.jt();
|
|
1477
|
+
var message = readText(packet);
|
|
1478
|
+
return new CloseReason(code, message);
|
|
1479
|
+
}
|
|
1480
|
+
function NonDisposableHandle() {
|
|
1481
|
+
}
|
|
1482
|
+
protoOf(NonDisposableHandle).gz = function () {
|
|
1483
|
+
return Unit_instance;
|
|
1484
|
+
};
|
|
1485
|
+
protoOf(NonDisposableHandle).toString = function () {
|
|
1486
|
+
return 'NonDisposableHandle';
|
|
1487
|
+
};
|
|
1488
|
+
protoOf(NonDisposableHandle).hashCode = function () {
|
|
1489
|
+
return 207988788;
|
|
1490
|
+
};
|
|
1491
|
+
protoOf(NonDisposableHandle).equals = function (other) {
|
|
1492
|
+
if (this === other)
|
|
1493
|
+
return true;
|
|
1494
|
+
if (!(other instanceof NonDisposableHandle))
|
|
1495
|
+
return false;
|
|
1496
|
+
return true;
|
|
1497
|
+
};
|
|
1498
|
+
var NonDisposableHandle_instance;
|
|
1499
|
+
function NonDisposableHandle_getInstance() {
|
|
1500
|
+
return NonDisposableHandle_instance;
|
|
1501
|
+
}
|
|
1502
|
+
function FrameTooBigException(frameSize, cause) {
|
|
1503
|
+
cause = cause === VOID ? null : cause;
|
|
1504
|
+
Exception_init_$Init$(cause, this);
|
|
1505
|
+
captureStack(this, FrameTooBigException);
|
|
1506
|
+
this.r3p_1 = frameSize;
|
|
1507
|
+
delete this.message;
|
|
1508
|
+
}
|
|
1509
|
+
protoOf(FrameTooBigException).e = function () {
|
|
1510
|
+
var sizeSuffix = compare(this.r3p_1, new Long(0, 0)) >= 0 ? ': ' + this.r3p_1.toString() : '';
|
|
1511
|
+
return 'Frame is too big' + sizeSuffix;
|
|
1512
|
+
};
|
|
1513
|
+
protoOf(FrameTooBigException).b15 = function () {
|
|
1514
|
+
return new FrameTooBigException(this.r3p_1, this);
|
|
1515
|
+
};
|
|
1516
|
+
var FrameType_TEXT_instance;
|
|
1517
|
+
var FrameType_BINARY_instance;
|
|
1518
|
+
var FrameType_CLOSE_instance;
|
|
1519
|
+
var FrameType_PING_instance;
|
|
1520
|
+
var FrameType_PONG_instance;
|
|
1521
|
+
function Companion_2() {
|
|
1522
|
+
Companion_instance_2 = this;
|
|
1523
|
+
var tmp = this;
|
|
1524
|
+
var tmp0 = get_entries_0();
|
|
1525
|
+
var tmp$ret$0;
|
|
1526
|
+
$l$block_0: {
|
|
1527
|
+
// Inline function 'kotlin.collections.maxByOrNull' call
|
|
1528
|
+
var iterator = tmp0.t();
|
|
1529
|
+
if (!iterator.u()) {
|
|
1530
|
+
tmp$ret$0 = null;
|
|
1531
|
+
break $l$block_0;
|
|
1532
|
+
}
|
|
1533
|
+
var maxElem = iterator.v();
|
|
1534
|
+
if (!iterator.u()) {
|
|
1535
|
+
tmp$ret$0 = maxElem;
|
|
1536
|
+
break $l$block_0;
|
|
1537
|
+
}
|
|
1538
|
+
var maxValue = maxElem.q3k_1;
|
|
1539
|
+
do {
|
|
1540
|
+
var e = iterator.v();
|
|
1541
|
+
var v = e.q3k_1;
|
|
1542
|
+
if (compareTo(maxValue, v) < 0) {
|
|
1543
|
+
maxElem = e;
|
|
1544
|
+
maxValue = v;
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
while (iterator.u());
|
|
1548
|
+
tmp$ret$0 = maxElem;
|
|
1549
|
+
}
|
|
1550
|
+
tmp.s3p_1 = ensureNotNull(tmp$ret$0).q3k_1;
|
|
1551
|
+
var tmp_0 = this;
|
|
1552
|
+
var tmp_1 = 0;
|
|
1553
|
+
var tmp_2 = this.s3p_1 + 1 | 0;
|
|
1554
|
+
// Inline function 'kotlin.arrayOfNulls' call
|
|
1555
|
+
var tmp_3 = Array(tmp_2);
|
|
1556
|
+
while (tmp_1 < tmp_2) {
|
|
1557
|
+
var tmp_4 = tmp_1;
|
|
1558
|
+
var tmp0_0 = get_entries_0();
|
|
1559
|
+
var tmp$ret$5;
|
|
1560
|
+
$l$block_2: {
|
|
1561
|
+
// Inline function 'kotlin.collections.singleOrNull' call
|
|
1562
|
+
var single = null;
|
|
1563
|
+
var found = false;
|
|
1564
|
+
var _iterator__ex2g4s = tmp0_0.t();
|
|
1565
|
+
while (_iterator__ex2g4s.u()) {
|
|
1566
|
+
var element = _iterator__ex2g4s.v();
|
|
1567
|
+
if (element.q3k_1 === tmp_4) {
|
|
1568
|
+
if (found) {
|
|
1569
|
+
tmp$ret$5 = null;
|
|
1570
|
+
break $l$block_2;
|
|
1571
|
+
}
|
|
1572
|
+
single = element;
|
|
1573
|
+
found = true;
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
if (!found) {
|
|
1577
|
+
tmp$ret$5 = null;
|
|
1578
|
+
break $l$block_2;
|
|
1579
|
+
}
|
|
1580
|
+
tmp$ret$5 = single;
|
|
1581
|
+
}
|
|
1582
|
+
tmp_3[tmp_4] = tmp$ret$5;
|
|
1583
|
+
tmp_1 = tmp_1 + 1 | 0;
|
|
1584
|
+
}
|
|
1585
|
+
tmp_0.t3p_1 = tmp_3;
|
|
1586
|
+
}
|
|
1587
|
+
var Companion_instance_2;
|
|
1588
|
+
function Companion_getInstance_2() {
|
|
1589
|
+
FrameType_initEntries();
|
|
1590
|
+
if (Companion_instance_2 == null)
|
|
1591
|
+
new Companion_2();
|
|
1592
|
+
return Companion_instance_2;
|
|
1593
|
+
}
|
|
1594
|
+
function values_0() {
|
|
1595
|
+
return [FrameType_TEXT_getInstance(), FrameType_BINARY_getInstance(), FrameType_CLOSE_getInstance(), FrameType_PING_getInstance(), FrameType_PONG_getInstance()];
|
|
1596
|
+
}
|
|
1597
|
+
function get_entries_0() {
|
|
1598
|
+
if ($ENTRIES_0 == null)
|
|
1599
|
+
$ENTRIES_0 = enumEntries(values_0());
|
|
1600
|
+
return $ENTRIES_0;
|
|
1601
|
+
}
|
|
1602
|
+
var FrameType_entriesInitialized;
|
|
1603
|
+
function FrameType_initEntries() {
|
|
1604
|
+
if (FrameType_entriesInitialized)
|
|
1605
|
+
return Unit_instance;
|
|
1606
|
+
FrameType_entriesInitialized = true;
|
|
1607
|
+
FrameType_TEXT_instance = new FrameType('TEXT', 0, false, 1);
|
|
1608
|
+
FrameType_BINARY_instance = new FrameType('BINARY', 1, false, 2);
|
|
1609
|
+
FrameType_CLOSE_instance = new FrameType('CLOSE', 2, true, 8);
|
|
1610
|
+
FrameType_PING_instance = new FrameType('PING', 3, true, 9);
|
|
1611
|
+
FrameType_PONG_instance = new FrameType('PONG', 4, true, 10);
|
|
1612
|
+
Companion_getInstance_2();
|
|
1613
|
+
}
|
|
1614
|
+
var $ENTRIES_0;
|
|
1615
|
+
function FrameType(name, ordinal, controlFrame, opcode) {
|
|
1616
|
+
Enum.call(this, name, ordinal);
|
|
1617
|
+
this.p3k_1 = controlFrame;
|
|
1618
|
+
this.q3k_1 = opcode;
|
|
1619
|
+
}
|
|
1620
|
+
function FrameType_TEXT_getInstance() {
|
|
1621
|
+
FrameType_initEntries();
|
|
1622
|
+
return FrameType_TEXT_instance;
|
|
1623
|
+
}
|
|
1624
|
+
function FrameType_BINARY_getInstance() {
|
|
1625
|
+
FrameType_initEntries();
|
|
1626
|
+
return FrameType_BINARY_instance;
|
|
1627
|
+
}
|
|
1628
|
+
function FrameType_CLOSE_getInstance() {
|
|
1629
|
+
FrameType_initEntries();
|
|
1630
|
+
return FrameType_CLOSE_instance;
|
|
1631
|
+
}
|
|
1632
|
+
function FrameType_PING_getInstance() {
|
|
1633
|
+
FrameType_initEntries();
|
|
1634
|
+
return FrameType_PING_instance;
|
|
1635
|
+
}
|
|
1636
|
+
function FrameType_PONG_getInstance() {
|
|
1637
|
+
FrameType_initEntries();
|
|
1638
|
+
return FrameType_PONG_instance;
|
|
1639
|
+
}
|
|
1640
|
+
function get_PongerCoroutineName() {
|
|
1641
|
+
_init_properties_PingPong_kt__9aqxey();
|
|
1642
|
+
return PongerCoroutineName;
|
|
1643
|
+
}
|
|
1644
|
+
var PongerCoroutineName;
|
|
1645
|
+
function get_PingerCoroutineName() {
|
|
1646
|
+
_init_properties_PingPong_kt__9aqxey();
|
|
1647
|
+
return PingerCoroutineName;
|
|
1648
|
+
}
|
|
1649
|
+
var PingerCoroutineName;
|
|
1650
|
+
function ponger(_this__u8e3s4, outgoing) {
|
|
1651
|
+
_init_properties_PingPong_kt__9aqxey();
|
|
1652
|
+
var channel = Channel(5);
|
|
1653
|
+
var tmp = get_PongerCoroutineName();
|
|
1654
|
+
launch(_this__u8e3s4, tmp, VOID, ponger$slambda_0(channel, outgoing, null));
|
|
1655
|
+
return channel;
|
|
1656
|
+
}
|
|
1657
|
+
function pinger(_this__u8e3s4, outgoing, periodMillis, timeoutMillis, onTimeout) {
|
|
1658
|
+
_init_properties_PingPong_kt__9aqxey();
|
|
1659
|
+
var actorJob = Job();
|
|
1660
|
+
var channel = Channel(2147483647);
|
|
1661
|
+
var tmp = actorJob.gj(get_PingerCoroutineName());
|
|
1662
|
+
launch(_this__u8e3s4, tmp, VOID, pinger$slambda_0(periodMillis, timeoutMillis, onTimeout, channel, outgoing, null));
|
|
1663
|
+
var tmp_0 = ensureNotNull(_this__u8e3s4.hw().t9(Key_instance));
|
|
1664
|
+
tmp_0.kx(pinger$lambda(actorJob));
|
|
1665
|
+
return channel;
|
|
1666
|
+
}
|
|
1667
|
+
function ponger$slambda($channel, $outgoing, resultContinuation) {
|
|
1668
|
+
this.c3q_1 = $channel;
|
|
1669
|
+
this.d3q_1 = $outgoing;
|
|
1670
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1671
|
+
}
|
|
1672
|
+
protoOf(ponger$slambda).k1n = function ($this$launch, $completion) {
|
|
1673
|
+
var tmp = this.l1n($this$launch, $completion);
|
|
1674
|
+
tmp.i9_1 = Unit_instance;
|
|
1675
|
+
tmp.j9_1 = null;
|
|
1676
|
+
return tmp.o9();
|
|
1677
|
+
};
|
|
1678
|
+
protoOf(ponger$slambda).ba = function (p1, $completion) {
|
|
1679
|
+
return this.k1n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
1680
|
+
};
|
|
1681
|
+
protoOf(ponger$slambda).o9 = function () {
|
|
1682
|
+
var suspendResult = this.i9_1;
|
|
1683
|
+
$sm: do
|
|
1684
|
+
try {
|
|
1685
|
+
var tmp = this.g9_1;
|
|
1686
|
+
switch (tmp) {
|
|
1687
|
+
case 0:
|
|
1688
|
+
this.h9_1 = 14;
|
|
1689
|
+
this.h9_1 = 13;
|
|
1690
|
+
this.i3q_1 = this.c3q_1;
|
|
1691
|
+
this.g9_1 = 1;
|
|
1692
|
+
continue $sm;
|
|
1693
|
+
case 1:
|
|
1694
|
+
this.g3q_1 = this.i3q_1;
|
|
1695
|
+
this.f3q_1 = null;
|
|
1696
|
+
this.g9_1 = 2;
|
|
1697
|
+
continue $sm;
|
|
1698
|
+
case 2:
|
|
1699
|
+
this.g9_1 = 3;
|
|
1700
|
+
continue $sm;
|
|
1701
|
+
case 3:
|
|
1702
|
+
this.h9_1 = 10;
|
|
1703
|
+
this.h9_1 = 9;
|
|
1704
|
+
this.h3q_1 = this.g3q_1.t();
|
|
1705
|
+
this.g9_1 = 4;
|
|
1706
|
+
continue $sm;
|
|
1707
|
+
case 4:
|
|
1708
|
+
this.g9_1 = 5;
|
|
1709
|
+
suspendResult = this.h3q_1.j1d(this);
|
|
1710
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1711
|
+
return suspendResult;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
continue $sm;
|
|
1715
|
+
case 5:
|
|
1716
|
+
if (!suspendResult) {
|
|
1717
|
+
this.g9_1 = 7;
|
|
1718
|
+
continue $sm;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
var e = this.h3q_1.v();
|
|
1722
|
+
get_LOGGER().q30('Received ping message, sending pong message');
|
|
1723
|
+
this.g9_1 = 6;
|
|
1724
|
+
suspendResult = this.d3q_1.g1f(new Pong(e.t3k_1), this);
|
|
1725
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1726
|
+
return suspendResult;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
continue $sm;
|
|
1730
|
+
case 6:
|
|
1731
|
+
this.g9_1 = 4;
|
|
1732
|
+
continue $sm;
|
|
1733
|
+
case 7:
|
|
1734
|
+
this.g9_1 = 8;
|
|
1735
|
+
var tmp_0 = this;
|
|
1736
|
+
continue $sm;
|
|
1737
|
+
case 8:
|
|
1738
|
+
this.h9_1 = 13;
|
|
1739
|
+
cancelConsumed(this.g3q_1, this.f3q_1);
|
|
1740
|
+
this.g9_1 = 12;
|
|
1741
|
+
continue $sm;
|
|
1742
|
+
case 9:
|
|
1743
|
+
this.h9_1 = 10;
|
|
1744
|
+
var tmp_1 = this.j9_1;
|
|
1745
|
+
if (tmp_1 instanceof Error) {
|
|
1746
|
+
var e_0 = this.j9_1;
|
|
1747
|
+
var tmp_2 = this;
|
|
1748
|
+
this.f3q_1 = e_0;
|
|
1749
|
+
throw e_0;
|
|
1750
|
+
} else {
|
|
1751
|
+
throw this.j9_1;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
case 10:
|
|
1755
|
+
this.h9_1 = 13;
|
|
1756
|
+
var t = this.j9_1;
|
|
1757
|
+
cancelConsumed(this.g3q_1, this.f3q_1);
|
|
1758
|
+
throw t;
|
|
1759
|
+
case 11:
|
|
1760
|
+
this.h9_1 = 13;
|
|
1761
|
+
cancelConsumed(this.g3q_1, this.f3q_1);
|
|
1762
|
+
if (false) {
|
|
1763
|
+
this.g9_1 = 1;
|
|
1764
|
+
continue $sm;
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
this.g9_1 = 12;
|
|
1768
|
+
continue $sm;
|
|
1769
|
+
case 12:
|
|
1770
|
+
this.h9_1 = 14;
|
|
1771
|
+
this.g9_1 = 15;
|
|
1772
|
+
continue $sm;
|
|
1773
|
+
case 13:
|
|
1774
|
+
this.h9_1 = 14;
|
|
1775
|
+
var tmp_3 = this.j9_1;
|
|
1776
|
+
if (tmp_3 instanceof ClosedSendChannelException) {
|
|
1777
|
+
var _unused_var__etf5q3 = this.j9_1;
|
|
1778
|
+
this.g9_1 = 15;
|
|
1779
|
+
continue $sm;
|
|
1780
|
+
} else {
|
|
1781
|
+
throw this.j9_1;
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
case 14:
|
|
1785
|
+
throw this.j9_1;
|
|
1786
|
+
case 15:
|
|
1787
|
+
this.h9_1 = 14;
|
|
1788
|
+
return Unit_instance;
|
|
1789
|
+
}
|
|
1790
|
+
} catch ($p) {
|
|
1791
|
+
var e_1 = $p;
|
|
1792
|
+
if (this.h9_1 === 14) {
|
|
1793
|
+
throw e_1;
|
|
1794
|
+
} else {
|
|
1795
|
+
this.g9_1 = this.h9_1;
|
|
1796
|
+
this.j9_1 = e_1;
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
while (true);
|
|
1800
|
+
};
|
|
1801
|
+
protoOf(ponger$slambda).l1n = function ($this$launch, completion) {
|
|
1802
|
+
var i = new ponger$slambda(this.c3q_1, this.d3q_1, completion);
|
|
1803
|
+
i.e3q_1 = $this$launch;
|
|
1804
|
+
return i;
|
|
1805
|
+
};
|
|
1806
|
+
function ponger$slambda_0($channel, $outgoing, resultContinuation) {
|
|
1807
|
+
var i = new ponger$slambda($channel, $outgoing, resultContinuation);
|
|
1808
|
+
return constructCallableReference(function ($this$launch, $completion) {
|
|
1809
|
+
return i.k1n($this$launch, $completion);
|
|
1810
|
+
}, 1);
|
|
1811
|
+
}
|
|
1812
|
+
function pinger$slambda$slambda($channel, resultContinuation) {
|
|
1813
|
+
this.r3q_1 = $channel;
|
|
1814
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1815
|
+
}
|
|
1816
|
+
protoOf(pinger$slambda$slambda).k1n = function ($this$withTimeoutOrNull, $completion) {
|
|
1817
|
+
var tmp = this.l1n($this$withTimeoutOrNull, $completion);
|
|
1818
|
+
tmp.i9_1 = Unit_instance;
|
|
1819
|
+
tmp.j9_1 = null;
|
|
1820
|
+
return tmp.o9();
|
|
1821
|
+
};
|
|
1822
|
+
protoOf(pinger$slambda$slambda).ba = function (p1, $completion) {
|
|
1823
|
+
return this.k1n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
1824
|
+
};
|
|
1825
|
+
protoOf(pinger$slambda$slambda).o9 = function () {
|
|
1826
|
+
var suspendResult = this.i9_1;
|
|
1827
|
+
$sm: do
|
|
1828
|
+
try {
|
|
1829
|
+
var tmp = this.g9_1;
|
|
1830
|
+
switch (tmp) {
|
|
1831
|
+
case 0:
|
|
1832
|
+
this.h9_1 = 3;
|
|
1833
|
+
this.g9_1 = 1;
|
|
1834
|
+
continue $sm;
|
|
1835
|
+
case 1:
|
|
1836
|
+
if (!true) {
|
|
1837
|
+
this.g9_1 = 4;
|
|
1838
|
+
continue $sm;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
this.g9_1 = 2;
|
|
1842
|
+
suspendResult = this.r3q_1.j1f(this);
|
|
1843
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1844
|
+
return suspendResult;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
continue $sm;
|
|
1848
|
+
case 2:
|
|
1849
|
+
this.g9_1 = 1;
|
|
1850
|
+
continue $sm;
|
|
1851
|
+
case 3:
|
|
1852
|
+
throw this.j9_1;
|
|
1853
|
+
case 4:
|
|
1854
|
+
return Unit_instance;
|
|
1855
|
+
}
|
|
1856
|
+
} catch ($p) {
|
|
1857
|
+
var e = $p;
|
|
1858
|
+
if (this.h9_1 === 3) {
|
|
1859
|
+
throw e;
|
|
1860
|
+
} else {
|
|
1861
|
+
this.g9_1 = this.h9_1;
|
|
1862
|
+
this.j9_1 = e;
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
while (true);
|
|
1866
|
+
};
|
|
1867
|
+
protoOf(pinger$slambda$slambda).l1n = function ($this$withTimeoutOrNull, completion) {
|
|
1868
|
+
var i = new pinger$slambda$slambda(this.r3q_1, completion);
|
|
1869
|
+
i.s3q_1 = $this$withTimeoutOrNull;
|
|
1870
|
+
return i;
|
|
1871
|
+
};
|
|
1872
|
+
function pinger$slambda$slambda_0($channel, resultContinuation) {
|
|
1873
|
+
var i = new pinger$slambda$slambda($channel, resultContinuation);
|
|
1874
|
+
return constructCallableReference(function ($this$withTimeoutOrNull, $completion) {
|
|
1875
|
+
return i.k1n($this$withTimeoutOrNull, $completion);
|
|
1876
|
+
}, 1);
|
|
1877
|
+
}
|
|
1878
|
+
function pinger$slambda$slambda_1($outgoing, $pingMessage, $channel, resultContinuation) {
|
|
1879
|
+
this.b3r_1 = $outgoing;
|
|
1880
|
+
this.c3r_1 = $pingMessage;
|
|
1881
|
+
this.d3r_1 = $channel;
|
|
1882
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1883
|
+
}
|
|
1884
|
+
protoOf(pinger$slambda$slambda_1).k1n = function ($this$withTimeoutOrNull, $completion) {
|
|
1885
|
+
var tmp = this.l1n($this$withTimeoutOrNull, $completion);
|
|
1886
|
+
tmp.i9_1 = Unit_instance;
|
|
1887
|
+
tmp.j9_1 = null;
|
|
1888
|
+
return tmp.o9();
|
|
1889
|
+
};
|
|
1890
|
+
protoOf(pinger$slambda$slambda_1).ba = function (p1, $completion) {
|
|
1891
|
+
return this.k1n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
1892
|
+
};
|
|
1893
|
+
protoOf(pinger$slambda$slambda_1).o9 = function () {
|
|
1894
|
+
var suspendResult = this.i9_1;
|
|
1895
|
+
$sm: do
|
|
1896
|
+
try {
|
|
1897
|
+
var tmp = this.g9_1;
|
|
1898
|
+
switch (tmp) {
|
|
1899
|
+
case 0:
|
|
1900
|
+
this.h9_1 = 6;
|
|
1901
|
+
get_LOGGER().q30('WebSocket Pinger: sending ping frame');
|
|
1902
|
+
this.g9_1 = 1;
|
|
1903
|
+
suspendResult = this.b3r_1.g1f(new Ping(toByteArray(this.c3r_1, Charsets_getInstance().z26_1)), this);
|
|
1904
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1905
|
+
return suspendResult;
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
continue $sm;
|
|
1909
|
+
case 1:
|
|
1910
|
+
this.g9_1 = 2;
|
|
1911
|
+
continue $sm;
|
|
1912
|
+
case 2:
|
|
1913
|
+
if (!true) {
|
|
1914
|
+
this.g9_1 = 5;
|
|
1915
|
+
continue $sm;
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
this.g9_1 = 3;
|
|
1919
|
+
suspendResult = this.d3r_1.j1f(this);
|
|
1920
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1921
|
+
return suspendResult;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
continue $sm;
|
|
1925
|
+
case 3:
|
|
1926
|
+
this.f3r_1 = suspendResult;
|
|
1927
|
+
if (decodeToString(this.f3r_1.t3k_1, 0, 0 + this.f3r_1.t3k_1.length | 0) === this.c3r_1) {
|
|
1928
|
+
var this_0 = get_LOGGER();
|
|
1929
|
+
if (get_isTraceEnabled(this_0)) {
|
|
1930
|
+
this_0.q30('WebSocket Pinger: received valid pong frame ' + this.f3r_1.toString());
|
|
1931
|
+
}
|
|
1932
|
+
this.g9_1 = 5;
|
|
1933
|
+
continue $sm;
|
|
1934
|
+
} else {
|
|
1935
|
+
this.g9_1 = 4;
|
|
1936
|
+
continue $sm;
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
case 4:
|
|
1940
|
+
var this_1 = get_LOGGER();
|
|
1941
|
+
if (get_isTraceEnabled(this_1)) {
|
|
1942
|
+
this_1.q30('WebSocket Pinger: received invalid pong frame ' + this.f3r_1.toString() + ', continue waiting');
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
this.g9_1 = 2;
|
|
1946
|
+
continue $sm;
|
|
1947
|
+
case 5:
|
|
1948
|
+
return Unit_instance;
|
|
1949
|
+
case 6:
|
|
1950
|
+
throw this.j9_1;
|
|
1951
|
+
}
|
|
1952
|
+
} catch ($p) {
|
|
1953
|
+
var e = $p;
|
|
1954
|
+
if (this.h9_1 === 6) {
|
|
1955
|
+
throw e;
|
|
1956
|
+
} else {
|
|
1957
|
+
this.g9_1 = this.h9_1;
|
|
1958
|
+
this.j9_1 = e;
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
while (true);
|
|
1962
|
+
};
|
|
1963
|
+
protoOf(pinger$slambda$slambda_1).l1n = function ($this$withTimeoutOrNull, completion) {
|
|
1964
|
+
var i = new pinger$slambda$slambda_1(this.b3r_1, this.c3r_1, this.d3r_1, completion);
|
|
1965
|
+
i.e3r_1 = $this$withTimeoutOrNull;
|
|
1966
|
+
return i;
|
|
1967
|
+
};
|
|
1968
|
+
function pinger$slambda$slambda_2($outgoing, $pingMessage, $channel, resultContinuation) {
|
|
1969
|
+
var i = new pinger$slambda$slambda_1($outgoing, $pingMessage, $channel, resultContinuation);
|
|
1970
|
+
return constructCallableReference(function ($this$withTimeoutOrNull, $completion) {
|
|
1971
|
+
return i.k1n($this$withTimeoutOrNull, $completion);
|
|
1972
|
+
}, 1);
|
|
1973
|
+
}
|
|
1974
|
+
function pinger$slambda($periodMillis, $timeoutMillis, $onTimeout, $channel, $outgoing, resultContinuation) {
|
|
1975
|
+
this.o3r_1 = $periodMillis;
|
|
1976
|
+
this.p3r_1 = $timeoutMillis;
|
|
1977
|
+
this.q3r_1 = $onTimeout;
|
|
1978
|
+
this.r3r_1 = $channel;
|
|
1979
|
+
this.s3r_1 = $outgoing;
|
|
1980
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1981
|
+
}
|
|
1982
|
+
protoOf(pinger$slambda).k1n = function ($this$launch, $completion) {
|
|
1983
|
+
var tmp = this.l1n($this$launch, $completion);
|
|
1984
|
+
tmp.i9_1 = Unit_instance;
|
|
1985
|
+
tmp.j9_1 = null;
|
|
1986
|
+
return tmp.o9();
|
|
1987
|
+
};
|
|
1988
|
+
protoOf(pinger$slambda).ba = function (p1, $completion) {
|
|
1989
|
+
return this.k1n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
1990
|
+
};
|
|
1991
|
+
protoOf(pinger$slambda).o9 = function () {
|
|
1992
|
+
var suspendResult = this.i9_1;
|
|
1993
|
+
$sm: do
|
|
1994
|
+
try {
|
|
1995
|
+
var tmp = this.g9_1;
|
|
1996
|
+
switch (tmp) {
|
|
1997
|
+
case 0:
|
|
1998
|
+
this.h9_1 = 8;
|
|
1999
|
+
var this_0 = get_LOGGER();
|
|
2000
|
+
if (get_isTraceEnabled(this_0)) {
|
|
2001
|
+
this_0.q30('Starting WebSocket pinger coroutine with period ' + this.o3r_1.toString() + ' ms and timeout ' + this.p3r_1.toString() + ' ms');
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
this.v3r_1 = Random(getTimeMillis());
|
|
2005
|
+
this.u3r_1 = new Int8Array(32);
|
|
2006
|
+
this.h9_1 = 7;
|
|
2007
|
+
this.g9_1 = 1;
|
|
2008
|
+
continue $sm;
|
|
2009
|
+
case 1:
|
|
2010
|
+
if (!true) {
|
|
2011
|
+
this.g9_1 = 6;
|
|
2012
|
+
continue $sm;
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
this.g9_1 = 2;
|
|
2016
|
+
suspendResult = withTimeoutOrNull(this.o3r_1, pinger$slambda$slambda_0(this.r3r_1, null), this);
|
|
2017
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2018
|
+
return suspendResult;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
continue $sm;
|
|
2022
|
+
case 2:
|
|
2023
|
+
this.v3r_1.wk(this.u3r_1);
|
|
2024
|
+
var pingMessage = '[ping ' + toHexString(this.u3r_1) + ' ping]';
|
|
2025
|
+
this.g9_1 = 3;
|
|
2026
|
+
suspendResult = withTimeoutOrNull(this.p3r_1, pinger$slambda$slambda_2(this.s3r_1, pingMessage, this.r3r_1, null), this);
|
|
2027
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2028
|
+
return suspendResult;
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
continue $sm;
|
|
2032
|
+
case 3:
|
|
2033
|
+
var rc = suspendResult;
|
|
2034
|
+
if (rc == null) {
|
|
2035
|
+
get_LOGGER().q30('WebSocket pinger has timed out');
|
|
2036
|
+
this.g9_1 = 5;
|
|
2037
|
+
suspendResult = this.q3r_1(CloseReason_init_$Create$(Codes_INTERNAL_ERROR_getInstance(), 'Ping timeout'), this);
|
|
2038
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2039
|
+
return suspendResult;
|
|
2040
|
+
}
|
|
2041
|
+
continue $sm;
|
|
2042
|
+
} else {
|
|
2043
|
+
this.g9_1 = 4;
|
|
2044
|
+
continue $sm;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
case 4:
|
|
2048
|
+
this.g9_1 = 1;
|
|
2049
|
+
continue $sm;
|
|
2050
|
+
case 5:
|
|
2051
|
+
this.g9_1 = 6;
|
|
2052
|
+
continue $sm;
|
|
2053
|
+
case 6:
|
|
2054
|
+
this.h9_1 = 8;
|
|
2055
|
+
this.g9_1 = 9;
|
|
2056
|
+
continue $sm;
|
|
2057
|
+
case 7:
|
|
2058
|
+
this.h9_1 = 8;
|
|
2059
|
+
var tmp_0 = this.j9_1;
|
|
2060
|
+
if (tmp_0 instanceof CancellationException) {
|
|
2061
|
+
var ignore = this.j9_1;
|
|
2062
|
+
this.g9_1 = 9;
|
|
2063
|
+
continue $sm;
|
|
2064
|
+
} else {
|
|
2065
|
+
var tmp_1 = this.j9_1;
|
|
2066
|
+
if (tmp_1 instanceof ClosedReceiveChannelException) {
|
|
2067
|
+
var ignore_0 = this.j9_1;
|
|
2068
|
+
this.g9_1 = 9;
|
|
2069
|
+
continue $sm;
|
|
2070
|
+
} else {
|
|
2071
|
+
var tmp_2 = this.j9_1;
|
|
2072
|
+
if (tmp_2 instanceof ClosedSendChannelException) {
|
|
2073
|
+
var ignore_1 = this.j9_1;
|
|
2074
|
+
this.g9_1 = 9;
|
|
2075
|
+
continue $sm;
|
|
2076
|
+
} else {
|
|
2077
|
+
var tmp_3 = this.j9_1;
|
|
2078
|
+
if (tmp_3 instanceof ClosedByteChannelException) {
|
|
2079
|
+
var ignore_2 = this.j9_1;
|
|
2080
|
+
this.g9_1 = 9;
|
|
2081
|
+
continue $sm;
|
|
2082
|
+
} else {
|
|
2083
|
+
throw this.j9_1;
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
case 8:
|
|
2090
|
+
throw this.j9_1;
|
|
2091
|
+
case 9:
|
|
2092
|
+
this.h9_1 = 8;
|
|
2093
|
+
return Unit_instance;
|
|
2094
|
+
}
|
|
2095
|
+
} catch ($p) {
|
|
2096
|
+
var e = $p;
|
|
2097
|
+
if (this.h9_1 === 8) {
|
|
2098
|
+
throw e;
|
|
2099
|
+
} else {
|
|
2100
|
+
this.g9_1 = this.h9_1;
|
|
2101
|
+
this.j9_1 = e;
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
while (true);
|
|
2105
|
+
};
|
|
2106
|
+
protoOf(pinger$slambda).l1n = function ($this$launch, completion) {
|
|
2107
|
+
var i = new pinger$slambda(this.o3r_1, this.p3r_1, this.q3r_1, this.r3r_1, this.s3r_1, completion);
|
|
2108
|
+
i.t3r_1 = $this$launch;
|
|
2109
|
+
return i;
|
|
2110
|
+
};
|
|
2111
|
+
function pinger$slambda_0($periodMillis, $timeoutMillis, $onTimeout, $channel, $outgoing, resultContinuation) {
|
|
2112
|
+
var i = new pinger$slambda($periodMillis, $timeoutMillis, $onTimeout, $channel, $outgoing, resultContinuation);
|
|
2113
|
+
return constructCallableReference(function ($this$launch, $completion) {
|
|
2114
|
+
return i.k1n($this$launch, $completion);
|
|
2115
|
+
}, 1);
|
|
2116
|
+
}
|
|
2117
|
+
function pinger$lambda($actorJob) {
|
|
2118
|
+
return function (it) {
|
|
2119
|
+
$actorJob.sx();
|
|
2120
|
+
return Unit_instance;
|
|
2121
|
+
};
|
|
2122
|
+
}
|
|
2123
|
+
var properties_initialized_PingPong_kt_fbfhmc;
|
|
2124
|
+
function _init_properties_PingPong_kt__9aqxey() {
|
|
2125
|
+
if (!properties_initialized_PingPong_kt_fbfhmc) {
|
|
2126
|
+
properties_initialized_PingPong_kt_fbfhmc = true;
|
|
2127
|
+
PongerCoroutineName = new CoroutineName('ws-ponger');
|
|
2128
|
+
PingerCoroutineName = new CoroutineName('ws-pinger');
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
function Companion_3() {
|
|
2132
|
+
Companion_instance_3 = this;
|
|
2133
|
+
var tmp = this;
|
|
2134
|
+
// Inline function 'kotlin.apply' call
|
|
2135
|
+
var this_0 = new WebSocketChannelsConfig();
|
|
2136
|
+
this_0.f3l_1 = this_0.w3r();
|
|
2137
|
+
this_0.g3l_1 = this_0.w3r();
|
|
2138
|
+
tmp.e3l_1 = this_0;
|
|
2139
|
+
}
|
|
2140
|
+
var Companion_instance_3;
|
|
2141
|
+
function Companion_getInstance_3() {
|
|
2142
|
+
if (Companion_instance_3 == null)
|
|
2143
|
+
new Companion_3();
|
|
2144
|
+
return Companion_instance_3;
|
|
2145
|
+
}
|
|
2146
|
+
function WebSocketChannelsConfig() {
|
|
2147
|
+
Companion_getInstance_3();
|
|
2148
|
+
this.f3l_1 = Companion_getInstance_4().x3r_1;
|
|
2149
|
+
this.g3l_1 = Companion_getInstance_4().x3r_1;
|
|
2150
|
+
}
|
|
2151
|
+
protoOf(WebSocketChannelsConfig).w3r = function () {
|
|
2152
|
+
return Companion_getInstance_4().x3r_1;
|
|
2153
|
+
};
|
|
2154
|
+
function from(_this__u8e3s4, config) {
|
|
2155
|
+
// Inline function 'kotlin.with' call
|
|
2156
|
+
var tmp;
|
|
2157
|
+
if (config.y3r_1 === 2147483647) {
|
|
2158
|
+
tmp = Channel(2147483647);
|
|
2159
|
+
} else if (config.z3r_1.equals(ChannelOverflow_SUSPEND_getInstance())) {
|
|
2160
|
+
tmp = Channel(config.y3r_1, BufferOverflow_SUSPEND_getInstance());
|
|
2161
|
+
} else if (config.z3r_1.equals(ChannelOverflow_CLOSE_getInstance())) {
|
|
2162
|
+
tmp = new BoundedChannel(config.y3r_1);
|
|
2163
|
+
} else {
|
|
2164
|
+
// Inline function 'kotlin.error' call
|
|
2165
|
+
var message = 'Unsupported channel config.';
|
|
2166
|
+
throw IllegalStateException_init_$Create$(toString(message));
|
|
2167
|
+
}
|
|
2168
|
+
return tmp;
|
|
2169
|
+
}
|
|
2170
|
+
function Companion_4() {
|
|
2171
|
+
Companion_instance_4 = this;
|
|
2172
|
+
this.x3r_1 = new ChannelConfig(2147483647, ChannelOverflow_SUSPEND_getInstance());
|
|
2173
|
+
}
|
|
2174
|
+
var Companion_instance_4;
|
|
2175
|
+
function Companion_getInstance_4() {
|
|
2176
|
+
if (Companion_instance_4 == null)
|
|
2177
|
+
new Companion_4();
|
|
2178
|
+
return Companion_instance_4;
|
|
2179
|
+
}
|
|
2180
|
+
function ChannelConfig(capacity, onOverflow) {
|
|
2181
|
+
Companion_getInstance_4();
|
|
2182
|
+
this.y3r_1 = capacity;
|
|
2183
|
+
this.z3r_1 = onOverflow;
|
|
2184
|
+
}
|
|
2185
|
+
protoOf(ChannelConfig).a3s = function () {
|
|
2186
|
+
return this.z3r_1.equals(ChannelOverflow_SUSPEND_getInstance()) && !(this.y3r_1 === 2147483647);
|
|
2187
|
+
};
|
|
2188
|
+
var ChannelOverflow_SUSPEND_instance;
|
|
2189
|
+
var ChannelOverflow_CLOSE_instance;
|
|
2190
|
+
var ChannelOverflow_entriesInitialized;
|
|
2191
|
+
function ChannelOverflow_initEntries() {
|
|
2192
|
+
if (ChannelOverflow_entriesInitialized)
|
|
2193
|
+
return Unit_instance;
|
|
2194
|
+
ChannelOverflow_entriesInitialized = true;
|
|
2195
|
+
ChannelOverflow_SUSPEND_instance = new ChannelOverflow('SUSPEND', 0);
|
|
2196
|
+
ChannelOverflow_CLOSE_instance = new ChannelOverflow('CLOSE', 1);
|
|
2197
|
+
}
|
|
2198
|
+
function ChannelOverflow(name, ordinal) {
|
|
2199
|
+
Enum.call(this, name, ordinal);
|
|
2200
|
+
}
|
|
2201
|
+
function BoundedChannel$Companion$createDelegate$lambda($channel) {
|
|
2202
|
+
return function (it) {
|
|
2203
|
+
var tmp;
|
|
2204
|
+
var tmp_0;
|
|
2205
|
+
if ($channel._v == null) {
|
|
2206
|
+
throwUninitializedPropertyAccessException('channel');
|
|
2207
|
+
} else {
|
|
2208
|
+
tmp_0 = $channel._v;
|
|
2209
|
+
}
|
|
2210
|
+
if (!tmp_0.l1d()) {
|
|
2211
|
+
var tmp_1;
|
|
2212
|
+
if ($channel._v == null) {
|
|
2213
|
+
throwUninitializedPropertyAccessException('channel');
|
|
2214
|
+
} else {
|
|
2215
|
+
tmp_1 = $channel._v;
|
|
2216
|
+
}
|
|
2217
|
+
tmp_1.l1f(new ChannelOverflowException('Channel overflowed'));
|
|
2218
|
+
tmp = Unit_instance;
|
|
2219
|
+
}
|
|
2220
|
+
return Unit_instance;
|
|
2221
|
+
};
|
|
2222
|
+
}
|
|
2223
|
+
function Companion_5() {
|
|
2224
|
+
}
|
|
2225
|
+
protoOf(Companion_5).b3s = function (capacity) {
|
|
2226
|
+
var channel = {_v: null};
|
|
2227
|
+
var tmp = BufferOverflow_DROP_OLDEST_getInstance();
|
|
2228
|
+
// Inline function 'kotlin.also' call
|
|
2229
|
+
var this_0 = Channel(capacity, tmp, BoundedChannel$Companion$createDelegate$lambda(channel));
|
|
2230
|
+
channel._v = this_0;
|
|
2231
|
+
return this_0;
|
|
2232
|
+
};
|
|
2233
|
+
var Companion_instance_5;
|
|
2234
|
+
function Companion_getInstance_5() {
|
|
2235
|
+
return Companion_instance_5;
|
|
2236
|
+
}
|
|
2237
|
+
function BoundedChannel(capacity, delegate) {
|
|
2238
|
+
delegate = delegate === VOID ? Companion_instance_5.b3s(capacity) : delegate;
|
|
2239
|
+
this.c3s_1 = delegate;
|
|
2240
|
+
}
|
|
2241
|
+
protoOf(BoundedChannel).d3s = function (element) {
|
|
2242
|
+
var result = this.c3s_1.h1f(element);
|
|
2243
|
+
if (!_ChannelResult___get_isSuccess__impl__odq1z9(result) && !_ChannelResult___get_isClosed__impl__mg7kuu(result)) {
|
|
2244
|
+
this.l1f(new ChannelOverflowException('Channel overflowed'));
|
|
2245
|
+
}
|
|
2246
|
+
return result;
|
|
2247
|
+
};
|
|
2248
|
+
protoOf(BoundedChannel).h1f = function (element) {
|
|
2249
|
+
return this.d3s(element);
|
|
2250
|
+
};
|
|
2251
|
+
protoOf(BoundedChannel).e3s = function (element, $completion) {
|
|
2252
|
+
return this.c3s_1.g1f(element, $completion);
|
|
2253
|
+
};
|
|
2254
|
+
protoOf(BoundedChannel).g1f = function (element, $completion) {
|
|
2255
|
+
return this.e3s(element, $completion);
|
|
2256
|
+
};
|
|
2257
|
+
protoOf(BoundedChannel).l1f = function (cause) {
|
|
2258
|
+
return this.c3s_1.l1f(cause);
|
|
2259
|
+
};
|
|
2260
|
+
protoOf(BoundedChannel).q1f = function (handler) {
|
|
2261
|
+
this.c3s_1.q1f(handler);
|
|
2262
|
+
};
|
|
2263
|
+
protoOf(BoundedChannel).l1d = function () {
|
|
2264
|
+
return this.c3s_1.l1d();
|
|
2265
|
+
};
|
|
2266
|
+
protoOf(BoundedChannel).f3s = function ($completion) {
|
|
2267
|
+
return this.c3s_1.j1f($completion);
|
|
2268
|
+
};
|
|
2269
|
+
protoOf(BoundedChannel).j1f = function ($completion) {
|
|
2270
|
+
return this.f3s($completion);
|
|
2271
|
+
};
|
|
2272
|
+
protoOf(BoundedChannel).t = function () {
|
|
2273
|
+
return this.c3s_1.t();
|
|
2274
|
+
};
|
|
2275
|
+
protoOf(BoundedChannel).rx = function (cause) {
|
|
2276
|
+
this.c3s_1.rx(cause);
|
|
2277
|
+
};
|
|
2278
|
+
function ChannelOverflowException(message) {
|
|
2279
|
+
RuntimeException_init_$Init$(message, this);
|
|
2280
|
+
captureStack(this, ChannelOverflowException);
|
|
2281
|
+
}
|
|
2282
|
+
function ChannelOverflow_SUSPEND_getInstance() {
|
|
2283
|
+
ChannelOverflow_initEntries();
|
|
2284
|
+
return ChannelOverflow_SUSPEND_instance;
|
|
2285
|
+
}
|
|
2286
|
+
function ChannelOverflow_CLOSE_getInstance() {
|
|
2287
|
+
ChannelOverflow_initEntries();
|
|
2288
|
+
return ChannelOverflow_CLOSE_instance;
|
|
2289
|
+
}
|
|
2290
|
+
function WebSocketExtension() {
|
|
2291
|
+
}
|
|
2292
|
+
function WebSocketExtensionsConfig() {
|
|
2293
|
+
var tmp = this;
|
|
2294
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
2295
|
+
tmp.i3s_1 = ArrayList_init_$Create$();
|
|
2296
|
+
var tmp_0 = this;
|
|
2297
|
+
// Inline function 'kotlin.arrayOf' call
|
|
2298
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
2299
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
2300
|
+
tmp_0.j3s_1 = [false, false, false];
|
|
2301
|
+
}
|
|
2302
|
+
protoOf(WebSocketExtensionsConfig).w2x = function () {
|
|
2303
|
+
// Inline function 'kotlin.collections.map' call
|
|
2304
|
+
var this_0 = this.i3s_1;
|
|
2305
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2306
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2307
|
+
var _iterator__ex2g4s = this_0.t();
|
|
2308
|
+
while (_iterator__ex2g4s.u()) {
|
|
2309
|
+
var item = _iterator__ex2g4s.v();
|
|
2310
|
+
var tmp$ret$2 = item();
|
|
2311
|
+
destination.e1(tmp$ret$2);
|
|
2312
|
+
}
|
|
2313
|
+
return destination;
|
|
2314
|
+
};
|
|
2315
|
+
function parametersToString($this) {
|
|
2316
|
+
return $this.l3s_1.r() ? '' : '; ' + joinToString($this.l3s_1, ';');
|
|
2317
|
+
}
|
|
2318
|
+
function WebSocketExtensionHeader(name, parameters) {
|
|
2319
|
+
this.k3s_1 = name;
|
|
2320
|
+
this.l3s_1 = parameters;
|
|
2321
|
+
}
|
|
2322
|
+
protoOf(WebSocketExtensionHeader).toString = function () {
|
|
2323
|
+
return this.k3s_1 + ' ' + parametersToString(this);
|
|
2324
|
+
};
|
|
2325
|
+
function parseWebSocketExtensions(value) {
|
|
2326
|
+
// Inline function 'kotlin.collections.map' call
|
|
2327
|
+
var this_0 = split(value, [',']);
|
|
2328
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2329
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2330
|
+
var _iterator__ex2g4s = this_0.t();
|
|
2331
|
+
while (_iterator__ex2g4s.u()) {
|
|
2332
|
+
var item = _iterator__ex2g4s.v();
|
|
2333
|
+
var extension = split(item, [';']);
|
|
2334
|
+
// Inline function 'kotlin.text.trim' call
|
|
2335
|
+
var this_1 = first(extension);
|
|
2336
|
+
var name = toString(trim(isCharSequence(this_1) ? this_1 : THROW_CCE()));
|
|
2337
|
+
// Inline function 'kotlin.collections.map' call
|
|
2338
|
+
var this_2 = drop(extension, 1);
|
|
2339
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2340
|
+
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
|
|
2341
|
+
var _iterator__ex2g4s_0 = this_2.t();
|
|
2342
|
+
while (_iterator__ex2g4s_0.u()) {
|
|
2343
|
+
var item_0 = _iterator__ex2g4s_0.v();
|
|
2344
|
+
// Inline function 'kotlin.text.trim' call
|
|
2345
|
+
var tmp$ret$6 = toString(trim(isCharSequence(item_0) ? item_0 : THROW_CCE()));
|
|
2346
|
+
destination_0.e1(tmp$ret$6);
|
|
2347
|
+
}
|
|
2348
|
+
var parameters = destination_0;
|
|
2349
|
+
var tmp$ret$2 = new WebSocketExtensionHeader(name, parameters);
|
|
2350
|
+
destination.e1(tmp$ret$2);
|
|
2351
|
+
}
|
|
2352
|
+
return destination;
|
|
2353
|
+
}
|
|
2354
|
+
function WebSocketSession() {
|
|
2355
|
+
}
|
|
2356
|
+
function close(_this__u8e3s4, reason, $completion) {
|
|
2357
|
+
reason = reason === VOID ? CloseReason_init_$Create$(Codes_NORMAL_getInstance(), '') : reason;
|
|
2358
|
+
var tmp = new $closeCOROUTINE$(_this__u8e3s4, reason, $completion);
|
|
2359
|
+
tmp.i9_1 = Unit_instance;
|
|
2360
|
+
tmp.j9_1 = null;
|
|
2361
|
+
return tmp.o9();
|
|
2362
|
+
}
|
|
2363
|
+
function closeExceptionally(_this__u8e3s4, cause, $completion) {
|
|
2364
|
+
var tmp;
|
|
2365
|
+
if (cause instanceof CancellationException) {
|
|
2366
|
+
tmp = CloseReason_init_$Create$(Codes_NORMAL_getInstance(), '');
|
|
2367
|
+
} else {
|
|
2368
|
+
var message = utf8Truncate(cause.toString(), 123);
|
|
2369
|
+
tmp = CloseReason_init_$Create$(Codes_INTERNAL_ERROR_getInstance(), message);
|
|
2370
|
+
}
|
|
2371
|
+
var reason = tmp;
|
|
2372
|
+
return close(_this__u8e3s4, reason, $completion);
|
|
2373
|
+
}
|
|
2374
|
+
function $closeCOROUTINE$(_this__u8e3s4, reason, resultContinuation) {
|
|
2375
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
2376
|
+
this.u3s_1 = _this__u8e3s4;
|
|
2377
|
+
this.v3s_1 = reason;
|
|
2378
|
+
}
|
|
2379
|
+
protoOf($closeCOROUTINE$).o9 = function () {
|
|
2380
|
+
var suspendResult = this.i9_1;
|
|
2381
|
+
$sm: do
|
|
2382
|
+
try {
|
|
2383
|
+
var tmp = this.g9_1;
|
|
2384
|
+
switch (tmp) {
|
|
2385
|
+
case 0:
|
|
2386
|
+
this.h9_1 = 4;
|
|
2387
|
+
this.h9_1 = 3;
|
|
2388
|
+
this.g9_1 = 1;
|
|
2389
|
+
suspendResult = this.u3s_1.d3l(Close_init_$Create$(this.v3s_1), this);
|
|
2390
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2391
|
+
return suspendResult;
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2394
|
+
continue $sm;
|
|
2395
|
+
case 1:
|
|
2396
|
+
this.g9_1 = 2;
|
|
2397
|
+
suspendResult = this.u3s_1.w1x(this);
|
|
2398
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2399
|
+
return suspendResult;
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
continue $sm;
|
|
2403
|
+
case 2:
|
|
2404
|
+
this.h9_1 = 4;
|
|
2405
|
+
this.g9_1 = 5;
|
|
2406
|
+
continue $sm;
|
|
2407
|
+
case 3:
|
|
2408
|
+
this.h9_1 = 4;
|
|
2409
|
+
var tmp_0 = this.j9_1;
|
|
2410
|
+
if (tmp_0 instanceof Error) {
|
|
2411
|
+
var _unused_var__etf5q3 = this.j9_1;
|
|
2412
|
+
this.g9_1 = 5;
|
|
2413
|
+
continue $sm;
|
|
2414
|
+
} else {
|
|
2415
|
+
throw this.j9_1;
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
case 4:
|
|
2419
|
+
throw this.j9_1;
|
|
2420
|
+
case 5:
|
|
2421
|
+
this.h9_1 = 4;
|
|
2422
|
+
return Unit_instance;
|
|
2423
|
+
}
|
|
2424
|
+
} catch ($p) {
|
|
2425
|
+
var e = $p;
|
|
2426
|
+
if (this.h9_1 === 4) {
|
|
2427
|
+
throw e;
|
|
2428
|
+
} else {
|
|
2429
|
+
this.g9_1 = this.h9_1;
|
|
2430
|
+
this.j9_1 = e;
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
while (true);
|
|
2434
|
+
};
|
|
2435
|
+
function Binary_init_$Init$(fin, data, $this) {
|
|
2436
|
+
Binary.call($this, fin, data, false, false, false);
|
|
2437
|
+
return $this;
|
|
2438
|
+
}
|
|
2439
|
+
function Binary_init_$Create$(fin, data) {
|
|
2440
|
+
return Binary_init_$Init$(fin, data, objectCreate(protoOf(Binary)));
|
|
2441
|
+
}
|
|
2442
|
+
function Text_init_$Init$(fin, data, $this) {
|
|
2443
|
+
Text.call($this, fin, data, false, false, false);
|
|
2444
|
+
return $this;
|
|
2445
|
+
}
|
|
2446
|
+
function Text_init_$Init$_0(text, $this) {
|
|
2447
|
+
Text_init_$Init$(true, toByteArray(text), $this);
|
|
2448
|
+
return $this;
|
|
2449
|
+
}
|
|
2450
|
+
function Text_init_$Create$(text) {
|
|
2451
|
+
return Text_init_$Init$_0(text, objectCreate(protoOf(Text)));
|
|
2452
|
+
}
|
|
2453
|
+
function Close_init_$Init$(reason, $this) {
|
|
2454
|
+
// Inline function 'io.ktor.utils.io.core.buildPacket' call
|
|
2455
|
+
var builder = new Buffer();
|
|
2456
|
+
builder.ru(reason.k3k_1);
|
|
2457
|
+
writeText(builder, reason.l3k_1);
|
|
2458
|
+
Close_init_$Init$_0(builder, $this);
|
|
2459
|
+
return $this;
|
|
2460
|
+
}
|
|
2461
|
+
function Close_init_$Create$(reason) {
|
|
2462
|
+
return Close_init_$Init$(reason, objectCreate(protoOf(Close)));
|
|
2463
|
+
}
|
|
2464
|
+
function Close_init_$Init$_0(packet, $this) {
|
|
2465
|
+
Close.call($this, readByteArray(packet));
|
|
2466
|
+
return $this;
|
|
2467
|
+
}
|
|
2468
|
+
function Close_init_$Init$_1($this) {
|
|
2469
|
+
Close.call($this, Companion_getInstance_6().s3o_1);
|
|
2470
|
+
return $this;
|
|
2471
|
+
}
|
|
2472
|
+
function Close_init_$Create$_0() {
|
|
2473
|
+
return Close_init_$Init$_1(objectCreate(protoOf(Close)));
|
|
2474
|
+
}
|
|
2475
|
+
function Binary(fin, data, rsv1, rsv2, rsv3) {
|
|
2476
|
+
rsv1 = rsv1 === VOID ? false : rsv1;
|
|
2477
|
+
rsv2 = rsv2 === VOID ? false : rsv2;
|
|
2478
|
+
rsv3 = rsv3 === VOID ? false : rsv3;
|
|
2479
|
+
Frame.call(this, fin, FrameType_BINARY_getInstance(), data, NonDisposableHandle_instance, rsv1, rsv2, rsv3);
|
|
2480
|
+
}
|
|
2481
|
+
function Text(fin, data, rsv1, rsv2, rsv3) {
|
|
2482
|
+
rsv1 = rsv1 === VOID ? false : rsv1;
|
|
2483
|
+
rsv2 = rsv2 === VOID ? false : rsv2;
|
|
2484
|
+
rsv3 = rsv3 === VOID ? false : rsv3;
|
|
2485
|
+
Frame.call(this, fin, FrameType_TEXT_getInstance(), data, NonDisposableHandle_instance, rsv1, rsv2, rsv3);
|
|
2486
|
+
}
|
|
2487
|
+
function Close(data) {
|
|
2488
|
+
Frame.call(this, true, FrameType_CLOSE_getInstance(), data, NonDisposableHandle_instance, false, false, false);
|
|
2489
|
+
}
|
|
2490
|
+
function Ping(data) {
|
|
2491
|
+
Frame.call(this, true, FrameType_PING_getInstance(), data, NonDisposableHandle_instance, false, false, false);
|
|
2492
|
+
}
|
|
2493
|
+
function Pong(data, disposableHandle) {
|
|
2494
|
+
disposableHandle = disposableHandle === VOID ? NonDisposableHandle_instance : disposableHandle;
|
|
2495
|
+
Frame.call(this, true, FrameType_PONG_getInstance(), data, disposableHandle, false, false, false);
|
|
2496
|
+
}
|
|
2497
|
+
function Companion_6() {
|
|
2498
|
+
Companion_instance_6 = this;
|
|
2499
|
+
this.s3o_1 = new Int8Array(0);
|
|
2500
|
+
}
|
|
2501
|
+
protoOf(Companion_6).t3o = function (fin, frameType, data, rsv1, rsv2, rsv3) {
|
|
2502
|
+
var tmp;
|
|
2503
|
+
switch (frameType.a1_1) {
|
|
2504
|
+
case 1:
|
|
2505
|
+
tmp = new Binary(fin, data, rsv1, rsv2, rsv3);
|
|
2506
|
+
break;
|
|
2507
|
+
case 0:
|
|
2508
|
+
tmp = new Text(fin, data, rsv1, rsv2, rsv3);
|
|
2509
|
+
break;
|
|
2510
|
+
case 2:
|
|
2511
|
+
tmp = new Close(data);
|
|
2512
|
+
break;
|
|
2513
|
+
case 3:
|
|
2514
|
+
tmp = new Ping(data);
|
|
2515
|
+
break;
|
|
2516
|
+
case 4:
|
|
2517
|
+
tmp = new Pong(data, NonDisposableHandle_instance);
|
|
2518
|
+
break;
|
|
2519
|
+
default:
|
|
2520
|
+
noWhenBranchMatchedException();
|
|
2521
|
+
break;
|
|
2522
|
+
}
|
|
2523
|
+
return tmp;
|
|
2524
|
+
};
|
|
2525
|
+
var Companion_instance_6;
|
|
2526
|
+
function Companion_getInstance_6() {
|
|
2527
|
+
if (Companion_instance_6 == null)
|
|
2528
|
+
new Companion_6();
|
|
2529
|
+
return Companion_instance_6;
|
|
2530
|
+
}
|
|
2531
|
+
function Frame(fin, frameType, data, disposableHandle, rsv1, rsv2, rsv3) {
|
|
2532
|
+
Companion_getInstance_6();
|
|
2533
|
+
disposableHandle = disposableHandle === VOID ? NonDisposableHandle_instance : disposableHandle;
|
|
2534
|
+
rsv1 = rsv1 === VOID ? false : rsv1;
|
|
2535
|
+
rsv2 = rsv2 === VOID ? false : rsv2;
|
|
2536
|
+
rsv3 = rsv3 === VOID ? false : rsv3;
|
|
2537
|
+
this.r3k_1 = fin;
|
|
2538
|
+
this.s3k_1 = frameType;
|
|
2539
|
+
this.t3k_1 = data;
|
|
2540
|
+
this.u3k_1 = disposableHandle;
|
|
2541
|
+
this.v3k_1 = rsv1;
|
|
2542
|
+
this.w3k_1 = rsv2;
|
|
2543
|
+
this.x3k_1 = rsv3;
|
|
2544
|
+
validateSize(this);
|
|
2545
|
+
}
|
|
2546
|
+
protoOf(Frame).toString = function () {
|
|
2547
|
+
return 'Frame ' + this.s3k_1.toString() + ' (fin=' + this.r3k_1 + ', buffer len = ' + this.t3k_1.length + ')';
|
|
2548
|
+
};
|
|
2549
|
+
function get_OUTGOING_CHANNEL_CAPACITY() {
|
|
2550
|
+
return OUTGOING_CHANNEL_CAPACITY;
|
|
2551
|
+
}
|
|
2552
|
+
var OUTGOING_CHANNEL_CAPACITY;
|
|
2553
|
+
//region block: post-declaration
|
|
2554
|
+
protoOf(DefaultWebSocketSessionImpl).d3l = send;
|
|
2555
|
+
defineProp(protoOf(FrameTooBigException), 'message', function () {
|
|
2556
|
+
return this.e();
|
|
2557
|
+
});
|
|
2558
|
+
protoOf(BoundedChannel).n1f = close$default;
|
|
2559
|
+
protoOf(BoundedChannel).p1f = cancel$default;
|
|
2560
|
+
//endregion
|
|
2561
|
+
//region block: init
|
|
2562
|
+
Companion_instance_0 = new Companion_0();
|
|
2563
|
+
NonDisposableHandle_instance = new NonDisposableHandle();
|
|
2564
|
+
Companion_instance_5 = new Companion_5();
|
|
2565
|
+
OUTGOING_CHANNEL_CAPACITY = null;
|
|
2566
|
+
//endregion
|
|
2567
|
+
//region block: exports
|
|
2568
|
+
export {
|
|
2569
|
+
Companion_getInstance as Companion_getInstanceo8cazic5dguk,
|
|
2570
|
+
Companion_getInstance_3 as Companion_getInstance27kujspvp4jub,
|
|
2571
|
+
Codes_CLOSED_ABNORMALLY_getInstance as Codes_CLOSED_ABNORMALLY_getInstance35h8511ldg1ec,
|
|
2572
|
+
Codes_NORMAL_getInstance as Codes_NORMAL_getInstance1njykag03saqj,
|
|
2573
|
+
send as send3vgnni2smbra3,
|
|
2574
|
+
Binary_init_$Create$ as Binary_init_$Create$1tryf04oicy2z,
|
|
2575
|
+
Close_init_$Create$ as Close_init_$Create$r368b6qas851,
|
|
2576
|
+
Text_init_$Create$ as Text_init_$Create$3e94pc3s749ft,
|
|
2577
|
+
CloseReason as CloseReason10cphaqpp3ct7,
|
|
2578
|
+
DefaultWebSocketSession_0 as DefaultWebSocketSessionmehckluw85jl,
|
|
2579
|
+
DefaultWebSocketSession as DefaultWebSocketSession3h8506yqzs5fx,
|
|
2580
|
+
WebSocketChannelsConfig as WebSocketChannelsConfig1qogztyrywmj9,
|
|
2581
|
+
WebSocketExtensionsConfig as WebSocketExtensionsConfig3sf1f7u7xi63m,
|
|
2582
|
+
WebSocketExtension as WebSocketExtensionixqq2y77p4e0,
|
|
2583
|
+
WebSocketSession as WebSocketSessionzi1ianvyj32u,
|
|
2584
|
+
from as from3gpkuvfyl3bft,
|
|
2585
|
+
parseWebSocketExtensions as parseWebSocketExtensionszyo25w86ylog,
|
|
2586
|
+
};
|
|
2587
|
+
//endregion
|
|
2588
|
+
|
|
2589
|
+
//# sourceMappingURL=ktor-ktor-websockets.mjs.map
|