@attocash/cli 0.2.3 → 0.3.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/README.md +148 -7
- package/dist/application/app.d.ts +34 -3
- package/dist/application/app.js +138 -126
- package/dist/application/operations.d.ts +3 -0
- package/dist/application/operations.js +30 -8
- package/dist/cli/cli.d.ts +1 -0
- package/dist/cli/cli.js +101 -13
- package/dist/cli/onboarding.d.ts +13 -0
- package/dist/cli/onboarding.js +99 -2
- package/dist/cli/output.js +18 -2
- package/dist/doctor/profile.js +2 -1
- package/dist/internal-marketplace.d.ts +25 -0
- package/dist/internal-marketplace.js +50 -0
- package/dist/marketplace/approval-files.d.ts +3 -0
- package/dist/marketplace/approval-files.js +97 -0
- package/dist/marketplace/approval-preview.d.ts +2 -0
- package/dist/marketplace/approval-preview.js +86 -0
- package/dist/marketplace/proof-approval.d.ts +82 -0
- package/dist/marketplace/proof-approval.js +671 -0
- package/dist/marketplace/topups.d.ts +82 -0
- package/dist/marketplace/topups.js +485 -0
- package/dist/network/batching.d.ts +2 -0
- package/dist/network/batching.js +23 -0
- package/dist/network/entry.d.ts +2 -0
- package/dist/network/entry.js +35 -0
- package/dist/network/reader.d.ts +2 -0
- package/dist/network/reader.js +125 -37
- package/dist/spending/approval.d.ts +5 -0
- package/dist/spending/approval.js +2 -0
- package/dist/spending/atto-x402.d.ts +31 -0
- package/dist/spending/atto-x402.js +174 -0
- package/dist/spending/ledger.d.ts +74 -2
- package/dist/spending/ledger.js +298 -7
- package/dist/spending/payments.d.ts +105 -5
- package/dist/spending/payments.js +795 -11
- package/dist/storage/recovery-seed.d.ts +13 -0
- package/dist/storage/recovery-seed.js +93 -0
- package/dist/storage/state.d.ts +4 -0
- package/dist/storage/state.js +32 -2
- package/dist/wallet/receive.d.ts +39 -0
- package/dist/wallet/receive.js +264 -0
- package/dist/wallet/signing.d.ts +1 -0
- package/dist/wallet/signing.js +37 -21
- package/dist/wallet/types.d.ts +1 -0
- package/node_modules/@attocash/commons-core/Kotlin-DateTime-library-kotlinx-datetime.mjs +1922 -1918
- package/node_modules/@attocash/commons-core/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/README.md +9 -0
- package/node_modules/@attocash/commons-core/commons-commons-core.d.mts +10 -0
- package/node_modules/@attocash/commons-core/commons-commons-core.mjs +2543 -2434
- package/node_modules/@attocash/commons-core/commons-commons-core.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/kotlin-kotlin-stdlib.mjs +4695 -4227
- package/node_modules/@attocash/commons-core/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-bytestring.mjs +60 -60
- package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-bytestring.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-core.mjs +651 -631
- package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs +2294 -2295
- package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
- package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-core/package.json +1 -1
- package/node_modules/@attocash/commons-node/commons-commons-node.d.mts +1 -0
- package/node_modules/@attocash/commons-node/commons-commons-node.mjs +873 -847
- package/node_modules/@attocash/commons-node/commons-commons-node.mjs.map +1 -1
- package/node_modules/@attocash/commons-node/kotlin-logging.mjs +109 -109
- package/node_modules/@attocash/commons-node/kotlin-logging.mjs.map +1 -1
- package/node_modules/@attocash/commons-node/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
- package/node_modules/@attocash/commons-node/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-node/package.json +3 -3
- package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.d.mts +1 -0
- package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.mjs +674 -640
- package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.mjs.map +1 -1
- package/node_modules/@attocash/commons-node-remote/kotlin-logging.mjs +109 -109
- package/node_modules/@attocash/commons-node-remote/kotlin-logging.mjs.map +1 -1
- package/node_modules/@attocash/commons-node-remote/kotlinx-browser.mjs.map +1 -1
- package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -1
- package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
- package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-node-remote/package.json +4 -4
- package/node_modules/@attocash/commons-transport/commons-commons-transport.d.mts +1 -0
- package/node_modules/@attocash/commons-transport/commons-commons-transport.mjs +52 -51
- package/node_modules/@attocash/commons-transport/commons-commons-transport.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/kotlinx-atomicfu.mjs +13 -13
- package/node_modules/@attocash/commons-transport/kotlinx-atomicfu.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/kotlinx-browser.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/kotlinx-coroutines-core.mjs +2639 -2608
- package/node_modules/@attocash/commons-transport/kotlinx-coroutines-core.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
- package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-client-content-negotiation.mjs +411 -196
- package/node_modules/@attocash/commons-transport/ktor-ktor-client-content-negotiation.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-client-core.mjs +2115 -1976
- package/node_modules/@attocash/commons-transport/ktor-ktor-client-core.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-events.mjs +7 -7
- package/node_modules/@attocash/commons-transport/ktor-ktor-events.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-http-cio.mjs +385 -384
- package/node_modules/@attocash/commons-transport/ktor-ktor-http-cio.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-http.mjs +1261 -1185
- package/node_modules/@attocash/commons-transport/ktor-ktor-http.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-io.mjs +668 -656
- package/node_modules/@attocash/commons-transport/ktor-ktor-io.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-openapi-schema.mjs +89 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-openapi-schema.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx-json.mjs +9 -9
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx.mjs +120 -128
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization.mjs +46 -49
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-sse.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-utils.mjs +1041 -985
- package/node_modules/@attocash/commons-transport/ktor-ktor-utils.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-websocket-serialization.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/ktor-ktor-websockets.mjs +530 -455
- package/node_modules/@attocash/commons-transport/ktor-ktor-websockets.mjs.map +1 -1
- package/node_modules/@attocash/commons-transport/package.json +4 -4
- package/node_modules/@attocash/commons-worker/commons-commons-worker.d.mts +1 -0
- package/node_modules/@attocash/commons-worker/commons-commons-worker.mjs +230 -226
- package/node_modules/@attocash/commons-worker/commons-commons-worker.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker/kotlin-logging.mjs +109 -109
- package/node_modules/@attocash/commons-worker/kotlin-logging.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
- package/node_modules/@attocash/commons-worker/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker/package.json +3 -3
- package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.d.mts +1 -0
- package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.mjs +91 -86
- package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker-remote/kotlin-logging.mjs +109 -109
- package/node_modules/@attocash/commons-worker-remote/kotlin-logging.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker-remote/kotlinx-browser.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json.mjs +1732 -1701
- package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/node_modules/@attocash/commons-worker-remote/package.json +4 -4
- package/package.json +9 -5
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
|
+
Unit_instance3kz1zqli6gr1r as Unit_instance,
|
|
3
|
+
Companion_instance13way2il9a8jt as Companion_instance,
|
|
4
|
+
VOID3gxj6tk5isa35 as VOID,
|
|
2
5
|
collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
|
|
3
6
|
mapCapacity1h45rc3eh9p2l as mapCapacity,
|
|
4
7
|
coerceAtLeast2bkz8m9ik7hep as coerceAtLeast,
|
|
5
8
|
LinkedHashMap1zhqxkxv3xnkl as LinkedHashMap,
|
|
6
|
-
Unit_instance3vdlo4e4f5ggx as Unit_instance,
|
|
7
9
|
initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
|
|
8
|
-
VOID3gxj6tk5isa35 as VOID,
|
|
9
10
|
enumEntries20mr21zbe3az4 as enumEntries,
|
|
10
11
|
Enum3alwj03lh1n41 as Enum,
|
|
11
12
|
initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
|
|
12
13
|
createThis2j2avj17cvnv2 as createThis,
|
|
14
|
+
IllegalArgumentException2asla15b5jaob as IllegalArgumentException,
|
|
13
15
|
toString1pkumu07cwy4m as toString,
|
|
14
16
|
getStringHashCode26igk1bx568vk as getStringHashCode,
|
|
17
|
+
substringiqarkczpya5m as substring,
|
|
18
|
+
charCodeAt1yspne1d8erbm as charCodeAt,
|
|
19
|
+
Char__toInt_impl_vasixd28v1p2u6jau5g as Char__toInt_impl_vasixd,
|
|
20
|
+
isHighSurrogate11jfjw70ar0zf as isHighSurrogate,
|
|
21
|
+
isLowSurrogateujxcv7hjn4ma as isLowSurrogate,
|
|
15
22
|
initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
|
|
16
23
|
isInterface3d6p8outrmvmk as isInterface,
|
|
17
|
-
IllegalArgumentException2asla15b5jaob as IllegalArgumentException,
|
|
18
24
|
toString30pk9tzaqopn as toString_0,
|
|
19
25
|
fromInt2ii0rejb1w62w as fromInt,
|
|
26
|
+
orPromise1iucc2to2udt2 as orPromise,
|
|
20
27
|
constructCallableReference23y65rf941mch as constructCallableReference,
|
|
21
28
|
ensureNotNull1e947j3ixpazm as ensureNotNull,
|
|
22
29
|
CancellationException3b36o9qz53rgr as CancellationException,
|
|
@@ -31,6 +38,7 @@ import {
|
|
|
31
38
|
decodeToString1dbzcjd620q25 as decodeToString,
|
|
32
39
|
Randomei1bbeye8rr8 as Random,
|
|
33
40
|
toHexString5bhtjxqec7ow as toHexString,
|
|
41
|
+
$3l5vvh8yg0ier as $,
|
|
34
42
|
throwUninitializedPropertyAccessException14fok093f3k3t as throwUninitializedPropertyAccessException,
|
|
35
43
|
RuntimeException1r3t0zl97011n as RuntimeException,
|
|
36
44
|
split2bvyvnrlcifjv as split,
|
|
@@ -42,28 +50,28 @@ import {
|
|
|
42
50
|
noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
|
|
43
51
|
} from '@attocash/commons-core/kotlin-kotlin-stdlib.mjs';
|
|
44
52
|
import {
|
|
45
|
-
|
|
53
|
+
Dispatchers_getInstance128lm494a5r5s as Dispatchers_getInstance,
|
|
46
54
|
launch1c91vkjzdi9sd as launch,
|
|
47
|
-
|
|
55
|
+
CoroutineStart_UNDISPATCHED_getInstance36t7e2kqqnuqp as CoroutineStart_UNDISPATCHED_getInstance,
|
|
48
56
|
ChannelResult2y4k69ac6y3du as ChannelResult,
|
|
49
|
-
|
|
57
|
+
_ChannelResult___get_isSuccess__impl__odq1z923tdiqn4dmkwh as _ChannelResult___get_isSuccess__impl__odq1z9,
|
|
50
58
|
cancelConsumed2i0oizqhmljf6 as cancelConsumed,
|
|
51
59
|
ClosedSendChannelException29m33prpq9jaw as ClosedSendChannelException,
|
|
52
60
|
ClosedReceiveChannelException3ofg6gf5f5b38 as ClosedReceiveChannelException,
|
|
53
61
|
CompletableDeferred2lnqvsbvx74d3 as CompletableDeferred,
|
|
54
62
|
Job13y4jkazwjho0 as Job,
|
|
55
|
-
|
|
63
|
+
Key_instancepi2bbb0csu5f as Key_instance,
|
|
56
64
|
CoroutineName2g5zosw74tf0f as CoroutineName,
|
|
57
|
-
|
|
65
|
+
Factory_getInstance14vrned6uf29d as Factory_getInstance,
|
|
58
66
|
DisposableHandle1uzxt8frdchxn as DisposableHandle,
|
|
59
67
|
CopyableThrowable1mvc99jcyvivf as CopyableThrowable,
|
|
60
68
|
Channel3r72atmcithql as Channel,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
close$
|
|
66
|
-
cancel$
|
|
69
|
+
withTimeoutOrNull2oszfz61ga8oq as withTimeoutOrNull,
|
|
70
|
+
BufferOverflow_SUSPEND_getInstance1ucmryz5dsuc2 as BufferOverflow_SUSPEND_getInstance,
|
|
71
|
+
BufferOverflow_DROP_OLDEST_getInstance2xuwx7fze5aij as BufferOverflow_DROP_OLDEST_getInstance,
|
|
72
|
+
_ChannelResult___get_isClosed__impl__mg7kuul2jcxqhngcqm as _ChannelResult___get_isClosed__impl__mg7kuu,
|
|
73
|
+
close$default2suggcywjwe8g as close$default,
|
|
74
|
+
cancel$default3v09jht7i082i as cancel$default,
|
|
67
75
|
SendChannel38sllbxw662ws as SendChannel,
|
|
68
76
|
ReceiveChannel24wu5e2tj9lbp as ReceiveChannel,
|
|
69
77
|
} from './kotlinx-coroutines-core.mjs';
|
|
@@ -79,7 +87,7 @@ import {
|
|
|
79
87
|
writeFully359t6q8kam2g5 as writeFully,
|
|
80
88
|
buildjygoh729rhy8 as build,
|
|
81
89
|
readText27783kyxjxi1g as readText,
|
|
82
|
-
|
|
90
|
+
Charsets_getInstancezrqwjk0yrlyw as Charsets_getInstance,
|
|
83
91
|
toByteArray1i3ns5jnoqlv6 as toByteArray,
|
|
84
92
|
ClosedByteChannelException3il8gfpye60w as ClosedByteChannelException,
|
|
85
93
|
writeText19qfzm98fbm4l as writeText,
|
|
@@ -99,55 +107,62 @@ var imul = Math.imul;
|
|
|
99
107
|
//region block: pre-declaration
|
|
100
108
|
class Companion {
|
|
101
109
|
constructor() {
|
|
102
|
-
|
|
110
|
+
Companion_instance_0 = this;
|
|
103
111
|
var tmp = this;
|
|
104
112
|
// Inline function 'kotlin.collections.associateBy' call
|
|
105
113
|
var this_0 = get_entries();
|
|
106
114
|
var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
|
|
107
115
|
// Inline function 'kotlin.collections.associateByTo' call
|
|
108
|
-
var destination = LinkedHashMap.
|
|
109
|
-
var _iterator__ex2g4s = this_0.
|
|
110
|
-
while (_iterator__ex2g4s.
|
|
111
|
-
var element = _iterator__ex2g4s.
|
|
112
|
-
var tmp$ret$2 = element.
|
|
113
|
-
destination.
|
|
116
|
+
var destination = LinkedHashMap.new_kotlin_collections_LinkedHashMap_31p40q_k$(capacity);
|
|
117
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
118
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
119
|
+
var element = _iterator__ex2g4s.next_20eer_k$();
|
|
120
|
+
var tmp$ret$2 = element.code_1;
|
|
121
|
+
destination.put_4fpzoq_k$(tmp$ret$2, element);
|
|
114
122
|
}
|
|
115
|
-
tmp.
|
|
116
|
-
this.
|
|
123
|
+
tmp.byCodeMap_1 = destination;
|
|
124
|
+
this.UNEXPECTED_CONDITION_1 = Codes_INTERNAL_ERROR_getInstance();
|
|
117
125
|
}
|
|
118
|
-
|
|
119
|
-
return this.
|
|
126
|
+
byCode_d9s8a4_k$(code) {
|
|
127
|
+
return this.byCodeMap_1.get_wei43m_k$(code);
|
|
120
128
|
}
|
|
121
129
|
}
|
|
122
130
|
class Codes extends Enum {
|
|
123
131
|
constructor(name, ordinal, code) {
|
|
124
132
|
super(name, ordinal);
|
|
125
|
-
this.
|
|
133
|
+
this.code_1 = code;
|
|
126
134
|
}
|
|
127
135
|
}
|
|
136
|
+
class Companion_0 {}
|
|
128
137
|
class CloseReason {
|
|
129
138
|
constructor(code, message) {
|
|
130
|
-
return new.target.
|
|
139
|
+
return new.target.new_io_ktor_websocket_CloseReason_a5tz4j_k$(code, message);
|
|
131
140
|
}
|
|
132
|
-
static
|
|
141
|
+
static new_io_ktor_websocket_CloseReason_a5tz4j_k$(code, message) {
|
|
133
142
|
var $this = createThis(this);
|
|
134
|
-
$this.
|
|
135
|
-
$this.
|
|
143
|
+
$this.code_1 = code;
|
|
144
|
+
$this.message_1 = message;
|
|
145
|
+
var size = utf8Size($this.message_1);
|
|
146
|
+
// Inline function 'kotlin.require' call
|
|
147
|
+
if (!(size <= 123)) {
|
|
148
|
+
var message_0 = 'Close reason message is too long: ' + size + ' bytes, but must not exceed ' + '123 bytes when UTF-8-encoded';
|
|
149
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message_0));
|
|
150
|
+
}
|
|
136
151
|
return $this;
|
|
137
152
|
}
|
|
138
|
-
static
|
|
139
|
-
return this.
|
|
153
|
+
static new_io_ktor_websocket_CloseReason_al0vxu_k$(code, message) {
|
|
154
|
+
return this.new_io_ktor_websocket_CloseReason_a5tz4j_k$(code.code_1, message);
|
|
140
155
|
}
|
|
141
|
-
|
|
142
|
-
return Companion_getInstance().
|
|
156
|
+
get_knownReason_j6teda_k$() {
|
|
157
|
+
return Companion_getInstance().byCode_d9s8a4_k$(this.code_1);
|
|
143
158
|
}
|
|
144
159
|
toString() {
|
|
145
|
-
var tmp0_elvis_lhs = this.
|
|
146
|
-
return 'CloseReason(reason=' + toString(tmp0_elvis_lhs == null ? this.
|
|
160
|
+
var tmp0_elvis_lhs = this.get_knownReason_j6teda_k$();
|
|
161
|
+
return 'CloseReason(reason=' + toString(tmp0_elvis_lhs == null ? this.code_1 : tmp0_elvis_lhs) + ', message=' + this.message_1 + ')';
|
|
147
162
|
}
|
|
148
163
|
hashCode() {
|
|
149
|
-
var result = this.
|
|
150
|
-
result = imul(result, 31) + getStringHashCode(this.
|
|
164
|
+
var result = this.code_1;
|
|
165
|
+
result = imul(result, 31) + getStringHashCode(this.message_1) | 0;
|
|
151
166
|
return result;
|
|
152
167
|
}
|
|
153
168
|
equals(other) {
|
|
@@ -155,87 +170,87 @@ class CloseReason {
|
|
|
155
170
|
return true;
|
|
156
171
|
if (!(other instanceof CloseReason))
|
|
157
172
|
return false;
|
|
158
|
-
if (!(this.
|
|
173
|
+
if (!(this.code_1 === other.code_1))
|
|
159
174
|
return false;
|
|
160
|
-
if (!(this.
|
|
175
|
+
if (!(this.message_1 === other.message_1))
|
|
161
176
|
return false;
|
|
162
177
|
return true;
|
|
163
178
|
}
|
|
164
179
|
}
|
|
165
180
|
class WebSocketSession {}
|
|
166
181
|
function *send(frame, $completion) {
|
|
167
|
-
yield* this.
|
|
182
|
+
yield* this.get_outgoing_us7o3v_k$().send_44jogj_k$(frame, $completion);
|
|
168
183
|
return Unit_instance;
|
|
169
184
|
}
|
|
170
185
|
class DefaultWebSocketSession {}
|
|
171
|
-
class
|
|
186
|
+
class Companion_1 {
|
|
172
187
|
constructor() {
|
|
173
|
-
|
|
174
|
-
this.
|
|
188
|
+
Companion_instance_2 = this;
|
|
189
|
+
this.EmptyPong_1 = Pong.new_io_ktor_websocket_Frame_Pong_hee4xw_k$(new Int8Array(0), NonDisposableHandle_instance);
|
|
175
190
|
}
|
|
176
191
|
}
|
|
177
192
|
class DefaultWebSocketSessionImpl {
|
|
178
193
|
constructor(raw, pingIntervalMillis, timeoutMillis, incomingFramesConfig, outgoingFramesConfig) {
|
|
179
|
-
|
|
180
|
-
this.
|
|
181
|
-
this.
|
|
182
|
-
this.
|
|
183
|
-
this.
|
|
184
|
-
this.
|
|
185
|
-
this.
|
|
186
|
-
this.
|
|
187
|
-
this.
|
|
194
|
+
Companion_getInstance_1();
|
|
195
|
+
this.raw_1 = raw;
|
|
196
|
+
this.pinger_1 = atomic$ref$1(null);
|
|
197
|
+
this.closeReasonRef_1 = CompletableDeferred();
|
|
198
|
+
this.context_1 = Job();
|
|
199
|
+
this.coroutineContext_1 = this.raw_1.get_coroutineContext_115oqo_k$().minusKey_9i5ggf_k$(Key_instance).plus_s13ygv_k$(this.context_1).plus_s13ygv_k$(new CoroutineName('ws-default'));
|
|
200
|
+
this.filtered_1 = from(Factory_getInstance(), incomingFramesConfig);
|
|
201
|
+
this.outgoingToBeProcessed_1 = from(Factory_getInstance(), outgoingFramesConfig);
|
|
202
|
+
this.closed_1 = atomic$boolean$1(false);
|
|
188
203
|
var tmp = this;
|
|
189
204
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
190
|
-
tmp.
|
|
191
|
-
this.
|
|
192
|
-
this.
|
|
193
|
-
this.
|
|
194
|
-
this.
|
|
205
|
+
tmp._extensions_1 = ArrayList.new_kotlin_collections_ArrayList_ony0vx_k$();
|
|
206
|
+
this.started_1 = atomic$boolean$1(false);
|
|
207
|
+
this.pingIntervalMillis_1 = pingIntervalMillis;
|
|
208
|
+
this.timeoutMillis_1 = timeoutMillis;
|
|
209
|
+
this.closeReason_1 = this.closeReasonRef_1;
|
|
195
210
|
}
|
|
196
|
-
|
|
197
|
-
return this.
|
|
211
|
+
get_coroutineContext_115oqo_k$() {
|
|
212
|
+
return this.coroutineContext_1;
|
|
198
213
|
}
|
|
199
|
-
|
|
200
|
-
return this.
|
|
214
|
+
get_incoming_u9os29_k$() {
|
|
215
|
+
return this.filtered_1;
|
|
201
216
|
}
|
|
202
|
-
|
|
203
|
-
return this.
|
|
217
|
+
get_outgoing_us7o3v_k$() {
|
|
218
|
+
return this.outgoingToBeProcessed_1;
|
|
204
219
|
}
|
|
205
|
-
|
|
206
|
-
return this.
|
|
220
|
+
get_extensions_kxksyl_k$() {
|
|
221
|
+
return this._extensions_1;
|
|
207
222
|
}
|
|
208
|
-
|
|
209
|
-
this.
|
|
223
|
+
set_maxFrameSize_k27os3_k$(value) {
|
|
224
|
+
this.raw_1.set_maxFrameSize_k27os3_k$(value);
|
|
210
225
|
}
|
|
211
|
-
|
|
212
|
-
return this.
|
|
226
|
+
get_maxFrameSize_9zaht9_k$() {
|
|
227
|
+
return this.raw_1.get_maxFrameSize_9zaht9_k$();
|
|
213
228
|
}
|
|
214
|
-
|
|
215
|
-
if (!this.
|
|
229
|
+
start_ye6294_k$(negotiatedExtensions) {
|
|
230
|
+
if (!this.started_1.atomicfu$compareAndSet(false, true)) {
|
|
216
231
|
// Inline function 'kotlin.error' call
|
|
217
232
|
var message = 'WebSocket session ' + toString(this) + ' is already started.';
|
|
218
|
-
throw IllegalStateException.
|
|
233
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message));
|
|
219
234
|
}
|
|
220
235
|
// Inline function 'io.ktor.util.logging.trace' call
|
|
221
236
|
var this_0 = get_LOGGER();
|
|
222
237
|
if (get_isTraceEnabled(this_0)) {
|
|
223
238
|
var tmp$ret$2 = 'Starting default WebSocketSession(' + toString(this) + ') ' + ('with negotiated extensions: ' + joinToString(negotiatedExtensions));
|
|
224
|
-
this_0.
|
|
239
|
+
this_0.trace_fti9bv_k$(tmp$ret$2);
|
|
225
240
|
}
|
|
226
|
-
this.
|
|
241
|
+
this._extensions_1.addAll_h3ej1q_k$(negotiatedExtensions);
|
|
227
242
|
runOrCancelPinger(this);
|
|
228
|
-
var incomingJob = runIncomingProcessor(this, ponger(this, this.
|
|
243
|
+
var incomingJob = runIncomingProcessor(this, ponger(this, this.get_outgoing_us7o3v_k$()));
|
|
229
244
|
var outgoingJob = runOutgoingProcessor(this);
|
|
230
245
|
launch(this, VOID, VOID, DefaultWebSocketSessionImpl$start$slambda(incomingJob, outgoingJob, this));
|
|
231
246
|
}
|
|
232
|
-
*
|
|
233
|
-
yield* this.
|
|
247
|
+
*flush_4wsz1p_k$($completion) {
|
|
248
|
+
yield* this.raw_1.flush_4wsz1p_k$($completion);
|
|
234
249
|
return Unit_instance;
|
|
235
250
|
}
|
|
236
251
|
}
|
|
237
252
|
class NonDisposableHandle {
|
|
238
|
-
|
|
253
|
+
dispose_3nnxhr_k$() {
|
|
239
254
|
return Unit_instance;
|
|
240
255
|
}
|
|
241
256
|
toString() {
|
|
@@ -254,61 +269,61 @@ class NonDisposableHandle {
|
|
|
254
269
|
}
|
|
255
270
|
class FrameTooBigException extends Exception {
|
|
256
271
|
constructor(frameSize, cause) {
|
|
257
|
-
return new.target.
|
|
272
|
+
return new.target.new_io_ktor_websocket_FrameTooBigException_7tb0yi_k$(frameSize, cause);
|
|
258
273
|
}
|
|
259
|
-
static
|
|
274
|
+
static new_io_ktor_websocket_FrameTooBigException_7tb0yi_k$(frameSize, cause) {
|
|
260
275
|
cause = cause === VOID ? null : cause;
|
|
261
|
-
var $this = this.
|
|
262
|
-
captureStack($this, $this
|
|
263
|
-
$this.
|
|
276
|
+
var $this = this.new_kotlin_Exception_bock1m_k$(cause);
|
|
277
|
+
captureStack($this, $this.$throwableCtor_2);
|
|
278
|
+
$this.frameSize_1 = frameSize;
|
|
264
279
|
delete $this.message;
|
|
265
280
|
return $this;
|
|
266
281
|
}
|
|
267
|
-
|
|
268
|
-
var sizeSuffix = this.
|
|
282
|
+
get_message_h23axq_k$() {
|
|
283
|
+
var sizeSuffix = this.frameSize_1 >= 0n ? ': ' + this.frameSize_1.toString() : '';
|
|
269
284
|
return 'Frame is too big' + sizeSuffix;
|
|
270
285
|
}
|
|
271
|
-
|
|
272
|
-
return FrameTooBigException.
|
|
286
|
+
createCopy_mmw9ld_k$() {
|
|
287
|
+
return FrameTooBigException.new_io_ktor_websocket_FrameTooBigException_7tb0yi_k$(this.frameSize_1, this);
|
|
273
288
|
}
|
|
274
289
|
get message() {
|
|
275
|
-
return this.
|
|
290
|
+
return this.get_message_h23axq_k$();
|
|
276
291
|
}
|
|
277
292
|
}
|
|
278
|
-
class
|
|
293
|
+
class Companion_2 {
|
|
279
294
|
constructor() {
|
|
280
|
-
|
|
295
|
+
Companion_instance_3 = this;
|
|
281
296
|
var tmp = this;
|
|
282
297
|
var tmp0 = get_entries_0();
|
|
283
298
|
var tmp$ret$0;
|
|
284
299
|
$l$block_0: {
|
|
285
300
|
// Inline function 'kotlin.collections.maxByOrNull' call
|
|
286
|
-
var iterator = tmp0.
|
|
287
|
-
if (!iterator.
|
|
301
|
+
var iterator = tmp0.iterator_jk1svi_k$();
|
|
302
|
+
if (!iterator.hasNext_bitz1p_k$()) {
|
|
288
303
|
tmp$ret$0 = null;
|
|
289
304
|
break $l$block_0;
|
|
290
305
|
}
|
|
291
|
-
var maxElem = iterator.
|
|
292
|
-
if (!iterator.
|
|
306
|
+
var maxElem = iterator.next_20eer_k$();
|
|
307
|
+
if (!iterator.hasNext_bitz1p_k$()) {
|
|
293
308
|
tmp$ret$0 = maxElem;
|
|
294
309
|
break $l$block_0;
|
|
295
310
|
}
|
|
296
|
-
var maxValue = maxElem.
|
|
311
|
+
var maxValue = maxElem.opcode_1;
|
|
297
312
|
do {
|
|
298
|
-
var e = iterator.
|
|
299
|
-
var v = e.
|
|
313
|
+
var e = iterator.next_20eer_k$();
|
|
314
|
+
var v = e.opcode_1;
|
|
300
315
|
if (compareTo(maxValue, v) < 0) {
|
|
301
316
|
maxElem = e;
|
|
302
317
|
maxValue = v;
|
|
303
318
|
}
|
|
304
319
|
}
|
|
305
|
-
while (iterator.
|
|
320
|
+
while (iterator.hasNext_bitz1p_k$());
|
|
306
321
|
tmp$ret$0 = maxElem;
|
|
307
322
|
}
|
|
308
|
-
tmp.
|
|
323
|
+
tmp.maxOpcode_1 = ensureNotNull(tmp$ret$0).opcode_1;
|
|
309
324
|
var tmp_0 = this;
|
|
310
325
|
var tmp_1 = 0;
|
|
311
|
-
var tmp_2 = this.
|
|
326
|
+
var tmp_2 = this.maxOpcode_1 + 1 | 0;
|
|
312
327
|
// Inline function 'kotlin.arrayOfNulls' call
|
|
313
328
|
var tmp_3 = Array(tmp_2);
|
|
314
329
|
while (tmp_1 < tmp_2) {
|
|
@@ -319,10 +334,10 @@ class Companion_1 {
|
|
|
319
334
|
// Inline function 'kotlin.collections.singleOrNull' call
|
|
320
335
|
var single = null;
|
|
321
336
|
var found = false;
|
|
322
|
-
var _iterator__ex2g4s = tmp0_0.
|
|
323
|
-
while (_iterator__ex2g4s.
|
|
324
|
-
var element = _iterator__ex2g4s.
|
|
325
|
-
if (element.
|
|
337
|
+
var _iterator__ex2g4s = tmp0_0.iterator_jk1svi_k$();
|
|
338
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
339
|
+
var element = _iterator__ex2g4s.next_20eer_k$();
|
|
340
|
+
if (element.opcode_1 === tmp_4) {
|
|
326
341
|
if (found) {
|
|
327
342
|
tmp$ret$5 = null;
|
|
328
343
|
break $l$block_2;
|
|
@@ -340,56 +355,56 @@ class Companion_1 {
|
|
|
340
355
|
tmp_3[tmp_4] = tmp$ret$5;
|
|
341
356
|
tmp_1 = tmp_1 + 1 | 0;
|
|
342
357
|
}
|
|
343
|
-
tmp_0.
|
|
358
|
+
tmp_0.byOpcodeArray_1 = tmp_3;
|
|
344
359
|
}
|
|
345
360
|
}
|
|
346
361
|
class FrameType extends Enum {
|
|
347
362
|
constructor(name, ordinal, controlFrame, opcode) {
|
|
348
363
|
super(name, ordinal);
|
|
349
|
-
this.
|
|
350
|
-
this.
|
|
364
|
+
this.controlFrame_1 = controlFrame;
|
|
365
|
+
this.opcode_1 = opcode;
|
|
351
366
|
}
|
|
352
367
|
}
|
|
353
|
-
class
|
|
368
|
+
class Companion_3 {
|
|
354
369
|
constructor() {
|
|
355
|
-
|
|
370
|
+
Companion_instance_4 = this;
|
|
356
371
|
var tmp = this;
|
|
357
372
|
// Inline function 'kotlin.apply' call
|
|
358
373
|
var this_0 = new WebSocketChannelsConfig();
|
|
359
|
-
this_0.
|
|
360
|
-
this_0.
|
|
361
|
-
tmp.
|
|
374
|
+
this_0.incoming_1 = this_0.unlimited_v80n35_k$();
|
|
375
|
+
this_0.outgoing_1 = this_0.unlimited_v80n35_k$();
|
|
376
|
+
tmp.UNLIMITED_1 = this_0;
|
|
362
377
|
}
|
|
363
378
|
}
|
|
364
379
|
class WebSocketChannelsConfig {
|
|
365
380
|
constructor() {
|
|
366
381
|
Companion_getInstance_2();
|
|
367
|
-
this.
|
|
368
|
-
this.
|
|
382
|
+
this.incoming_1 = Companion_getInstance_3().UNLIMITED_1;
|
|
383
|
+
this.outgoing_1 = Companion_getInstance_3().UNLIMITED_1;
|
|
369
384
|
}
|
|
370
|
-
|
|
371
|
-
return Companion_getInstance_3().
|
|
385
|
+
unlimited_v80n35_k$() {
|
|
386
|
+
return Companion_getInstance_3().UNLIMITED_1;
|
|
372
387
|
}
|
|
373
388
|
}
|
|
374
|
-
class
|
|
389
|
+
class Companion_4 {
|
|
375
390
|
constructor() {
|
|
376
|
-
|
|
377
|
-
this.
|
|
391
|
+
Companion_instance_5 = this;
|
|
392
|
+
this.UNLIMITED_1 = new ChannelConfig(2147483647, ChannelOverflow_SUSPEND_getInstance());
|
|
378
393
|
}
|
|
379
394
|
}
|
|
380
395
|
class ChannelConfig {
|
|
381
396
|
constructor(capacity, onOverflow) {
|
|
382
397
|
Companion_getInstance_3();
|
|
383
|
-
this.
|
|
384
|
-
this.
|
|
398
|
+
this.capacity_1 = capacity;
|
|
399
|
+
this.onOverflow_1 = onOverflow;
|
|
385
400
|
}
|
|
386
|
-
|
|
387
|
-
return this.
|
|
401
|
+
get_canSuspend_2zrbcb_k$() {
|
|
402
|
+
return this.onOverflow_1.equals(ChannelOverflow_SUSPEND_getInstance()) && !(this.capacity_1 === 2147483647);
|
|
388
403
|
}
|
|
389
404
|
}
|
|
390
405
|
class ChannelOverflow extends Enum {}
|
|
391
|
-
class
|
|
392
|
-
|
|
406
|
+
class Companion_5 {
|
|
407
|
+
createDelegate_n5r3h5_k$(capacity) {
|
|
393
408
|
var channel = {_v: null};
|
|
394
409
|
var tmp = BufferOverflow_DROP_OLDEST_getInstance();
|
|
395
410
|
// Inline function 'kotlin.also' call
|
|
@@ -400,52 +415,52 @@ class Companion_4 {
|
|
|
400
415
|
}
|
|
401
416
|
class BoundedChannel {
|
|
402
417
|
constructor(capacity, delegate) {
|
|
403
|
-
delegate = delegate === VOID ?
|
|
404
|
-
this.
|
|
418
|
+
delegate = delegate === VOID ? Companion_instance_6.createDelegate_n5r3h5_k$(capacity) : delegate;
|
|
419
|
+
this.delegate_1 = delegate;
|
|
405
420
|
}
|
|
406
|
-
|
|
407
|
-
var result = this.
|
|
421
|
+
trySend_w1juo7_k$(element) {
|
|
422
|
+
var result = this.delegate_1.trySend_62dpg8_k$(element);
|
|
408
423
|
if (!_ChannelResult___get_isSuccess__impl__odq1z9(result) && !_ChannelResult___get_isClosed__impl__mg7kuu(result)) {
|
|
409
|
-
this.
|
|
424
|
+
this.close_ukldxa_k$(ChannelOverflowException.new_io_ktor_websocket_ChannelOverflowException_hoqwtd_k$('Channel overflowed'));
|
|
410
425
|
}
|
|
411
426
|
return result;
|
|
412
427
|
}
|
|
413
|
-
|
|
414
|
-
return this.
|
|
428
|
+
trySend_62dpg8_k$(element) {
|
|
429
|
+
return this.trySend_w1juo7_k$(element);
|
|
415
430
|
}
|
|
416
|
-
*
|
|
417
|
-
yield* this.
|
|
431
|
+
*send_7nf3lq_k$(element, $completion) {
|
|
432
|
+
yield* this.delegate_1.send_44jogj_k$(element, $completion);
|
|
418
433
|
return Unit_instance;
|
|
419
434
|
}
|
|
420
|
-
|
|
421
|
-
return this.
|
|
435
|
+
send_44jogj_k$(element, $completion) {
|
|
436
|
+
return this.send_7nf3lq_k$(element, $completion);
|
|
422
437
|
}
|
|
423
|
-
|
|
424
|
-
return this.
|
|
438
|
+
close_ukldxa_k$(cause) {
|
|
439
|
+
return this.delegate_1.close_ukldxa_k$(cause);
|
|
425
440
|
}
|
|
426
|
-
|
|
427
|
-
return this.
|
|
441
|
+
get_isClosedForSend_ajczci_k$() {
|
|
442
|
+
return this.delegate_1.get_isClosedForSend_ajczci_k$();
|
|
428
443
|
}
|
|
429
|
-
*
|
|
430
|
-
return yield* this.
|
|
444
|
+
*receive_cnugsq_k$($completion) {
|
|
445
|
+
return yield* this.delegate_1.receive_awoumx_k$($completion);
|
|
431
446
|
}
|
|
432
|
-
|
|
433
|
-
return this.
|
|
447
|
+
receive_awoumx_k$($completion) {
|
|
448
|
+
return this.receive_cnugsq_k$($completion);
|
|
434
449
|
}
|
|
435
|
-
|
|
436
|
-
return this.
|
|
450
|
+
iterator_jk1svi_k$() {
|
|
451
|
+
return this.delegate_1.iterator_jk1svi_k$();
|
|
437
452
|
}
|
|
438
|
-
|
|
439
|
-
this.
|
|
453
|
+
cancel_hkmm2i_k$(cause) {
|
|
454
|
+
this.delegate_1.cancel_hkmm2i_k$(cause);
|
|
440
455
|
}
|
|
441
456
|
}
|
|
442
457
|
class ChannelOverflowException extends RuntimeException {
|
|
443
458
|
constructor(message) {
|
|
444
|
-
return new.target.
|
|
459
|
+
return new.target.new_io_ktor_websocket_ChannelOverflowException_hoqwtd_k$(message);
|
|
445
460
|
}
|
|
446
|
-
static
|
|
447
|
-
var $this = this.
|
|
448
|
-
captureStack($this, $this
|
|
461
|
+
static new_io_ktor_websocket_ChannelOverflowException_hoqwtd_k$(message) {
|
|
462
|
+
var $this = this.new_kotlin_RuntimeException_xu1s8h_k$(message);
|
|
463
|
+
captureStack($this, $this.$throwableCtor_3);
|
|
449
464
|
return $this;
|
|
450
465
|
}
|
|
451
466
|
}
|
|
@@ -454,148 +469,149 @@ class WebSocketExtensionsConfig {
|
|
|
454
469
|
constructor() {
|
|
455
470
|
var tmp = this;
|
|
456
471
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
457
|
-
tmp.
|
|
472
|
+
tmp.installers_1 = ArrayList.new_kotlin_collections_ArrayList_ony0vx_k$();
|
|
458
473
|
var tmp_0 = this;
|
|
459
474
|
// Inline function 'kotlin.arrayOf' call
|
|
460
475
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
461
476
|
// Inline function 'kotlin.js.asDynamic' call
|
|
462
|
-
tmp_0.
|
|
477
|
+
tmp_0.rcv_1 = [false, false, false];
|
|
463
478
|
}
|
|
464
|
-
|
|
479
|
+
build_1k0s4u_k$() {
|
|
465
480
|
// Inline function 'kotlin.collections.map' call
|
|
466
|
-
var this_0 = this.
|
|
481
|
+
var this_0 = this.installers_1;
|
|
467
482
|
// Inline function 'kotlin.collections.mapTo' call
|
|
468
|
-
var destination = ArrayList.
|
|
469
|
-
var _iterator__ex2g4s = this_0.
|
|
470
|
-
while (_iterator__ex2g4s.
|
|
471
|
-
var item = _iterator__ex2g4s.
|
|
483
|
+
var destination = ArrayList.new_kotlin_collections_ArrayList_tdd6ob_k$(collectionSizeOrDefault(this_0, 10));
|
|
484
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
485
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
486
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
472
487
|
var tmp$ret$2 = item();
|
|
473
|
-
destination.
|
|
488
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
474
489
|
}
|
|
475
490
|
return destination;
|
|
476
491
|
}
|
|
477
492
|
}
|
|
478
493
|
class WebSocketExtensionHeader {
|
|
479
494
|
constructor(name, parameters) {
|
|
480
|
-
this.
|
|
481
|
-
this.
|
|
495
|
+
this.name_1 = name;
|
|
496
|
+
this.parameters_1 = parameters;
|
|
482
497
|
}
|
|
483
498
|
toString() {
|
|
484
|
-
return this.
|
|
499
|
+
return this.name_1 + ' ' + parametersToString(this);
|
|
485
500
|
}
|
|
486
501
|
}
|
|
487
502
|
class Frame {
|
|
488
|
-
static
|
|
503
|
+
static new_io_ktor_websocket_Frame_fjyusq_k$(fin, frameType, data, disposableHandle, rsv1, rsv2, rsv3) {
|
|
489
504
|
Companion_getInstance_5();
|
|
490
505
|
disposableHandle = disposableHandle === VOID ? NonDisposableHandle_instance : disposableHandle;
|
|
491
506
|
rsv1 = rsv1 === VOID ? false : rsv1;
|
|
492
507
|
rsv2 = rsv2 === VOID ? false : rsv2;
|
|
493
508
|
rsv3 = rsv3 === VOID ? false : rsv3;
|
|
494
509
|
var $this = createThis(this);
|
|
495
|
-
$this.
|
|
496
|
-
$this.
|
|
497
|
-
$this.
|
|
498
|
-
$this.
|
|
499
|
-
$this.
|
|
500
|
-
$this.
|
|
501
|
-
$this.
|
|
510
|
+
$this.fin_1 = fin;
|
|
511
|
+
$this.frameType_1 = frameType;
|
|
512
|
+
$this.data_1 = data;
|
|
513
|
+
$this.disposableHandle_1 = disposableHandle;
|
|
514
|
+
$this.rsv1__1 = rsv1;
|
|
515
|
+
$this.rsv2__1 = rsv2;
|
|
516
|
+
$this.rsv3__1 = rsv3;
|
|
517
|
+
validateSize($this);
|
|
502
518
|
return $this;
|
|
503
519
|
}
|
|
504
520
|
toString() {
|
|
505
|
-
return 'Frame ' + this.
|
|
521
|
+
return 'Frame ' + this.frameType_1.toString() + ' (fin=' + this.fin_1 + ', buffer len = ' + this.data_1.length + ')';
|
|
506
522
|
}
|
|
507
523
|
}
|
|
508
524
|
class Binary extends Frame {
|
|
509
525
|
constructor(fin, data, rsv1, rsv2, rsv3) {
|
|
510
|
-
return new.target.
|
|
526
|
+
return new.target.new_io_ktor_websocket_Frame_Binary_yf73xr_k$(fin, data, rsv1, rsv2, rsv3);
|
|
511
527
|
}
|
|
512
|
-
static
|
|
528
|
+
static new_io_ktor_websocket_Frame_Binary_yf73xr_k$(fin, data, rsv1, rsv2, rsv3) {
|
|
513
529
|
rsv1 = rsv1 === VOID ? false : rsv1;
|
|
514
530
|
rsv2 = rsv2 === VOID ? false : rsv2;
|
|
515
531
|
rsv3 = rsv3 === VOID ? false : rsv3;
|
|
516
|
-
return this.
|
|
532
|
+
return this.new_io_ktor_websocket_Frame_fjyusq_k$(fin, FrameType_BINARY_getInstance(), data, NonDisposableHandle_instance, rsv1, rsv2, rsv3);
|
|
517
533
|
}
|
|
518
|
-
static
|
|
519
|
-
return this.
|
|
534
|
+
static new_io_ktor_websocket_Frame_Binary_dw7hrz_k$(fin, data) {
|
|
535
|
+
return this.new_io_ktor_websocket_Frame_Binary_yf73xr_k$(fin, data, false, false, false);
|
|
520
536
|
}
|
|
521
537
|
}
|
|
522
538
|
class Text extends Frame {
|
|
523
539
|
constructor(fin, data, rsv1, rsv2, rsv3) {
|
|
524
|
-
return new.target.
|
|
540
|
+
return new.target.new_io_ktor_websocket_Frame_Text_sv4r43_k$(fin, data, rsv1, rsv2, rsv3);
|
|
525
541
|
}
|
|
526
|
-
static
|
|
542
|
+
static new_io_ktor_websocket_Frame_Text_sv4r43_k$(fin, data, rsv1, rsv2, rsv3) {
|
|
527
543
|
rsv1 = rsv1 === VOID ? false : rsv1;
|
|
528
544
|
rsv2 = rsv2 === VOID ? false : rsv2;
|
|
529
545
|
rsv3 = rsv3 === VOID ? false : rsv3;
|
|
530
|
-
return this.
|
|
546
|
+
return this.new_io_ktor_websocket_Frame_fjyusq_k$(fin, FrameType_TEXT_getInstance(), data, NonDisposableHandle_instance, rsv1, rsv2, rsv3);
|
|
531
547
|
}
|
|
532
|
-
static
|
|
533
|
-
return this.
|
|
548
|
+
static new_io_ktor_websocket_Frame_Text_ejsfdh_k$(fin, data) {
|
|
549
|
+
return this.new_io_ktor_websocket_Frame_Text_sv4r43_k$(fin, data, false, false, false);
|
|
534
550
|
}
|
|
535
|
-
static
|
|
536
|
-
return this.
|
|
551
|
+
static new_io_ktor_websocket_Frame_Text_j2nyd2_k$(text) {
|
|
552
|
+
return this.new_io_ktor_websocket_Frame_Text_ejsfdh_k$(true, toByteArray(text));
|
|
537
553
|
}
|
|
538
554
|
}
|
|
539
555
|
class Close extends Frame {
|
|
540
556
|
constructor(data) {
|
|
541
|
-
return new.target.
|
|
557
|
+
return new.target.new_io_ktor_websocket_Frame_Close_1zir9_k$(data);
|
|
542
558
|
}
|
|
543
|
-
static
|
|
544
|
-
return this.
|
|
559
|
+
static new_io_ktor_websocket_Frame_Close_1zir9_k$(data) {
|
|
560
|
+
return this.new_io_ktor_websocket_Frame_fjyusq_k$(true, FrameType_CLOSE_getInstance(), data, NonDisposableHandle_instance, false, false, false);
|
|
545
561
|
}
|
|
546
|
-
static
|
|
562
|
+
static new_io_ktor_websocket_Frame_Close_zgly5v_k$(reason) {
|
|
547
563
|
// Inline function 'io.ktor.utils.io.core.buildPacket' call
|
|
548
564
|
var builder = new Buffer();
|
|
549
|
-
builder.
|
|
550
|
-
writeText(builder, reason.
|
|
551
|
-
return this.
|
|
565
|
+
builder.writeShort_vn2jsb_k$(reason.code_1);
|
|
566
|
+
writeText(builder, reason.message_1);
|
|
567
|
+
return this.new_io_ktor_websocket_Frame_Close_dmkrzr_k$(builder);
|
|
552
568
|
}
|
|
553
|
-
static
|
|
554
|
-
return this.
|
|
569
|
+
static new_io_ktor_websocket_Frame_Close_dmkrzr_k$(packet) {
|
|
570
|
+
return this.new_io_ktor_websocket_Frame_Close_1zir9_k$(readByteArray(packet));
|
|
555
571
|
}
|
|
556
|
-
static
|
|
557
|
-
return this.
|
|
572
|
+
static new_io_ktor_websocket_Frame_Close_ddsmnf_k$() {
|
|
573
|
+
return this.new_io_ktor_websocket_Frame_Close_1zir9_k$(Companion_getInstance_5().Empty_1);
|
|
558
574
|
}
|
|
559
575
|
}
|
|
560
576
|
class Ping extends Frame {
|
|
561
577
|
constructor(data) {
|
|
562
|
-
return new.target.
|
|
578
|
+
return new.target.new_io_ktor_websocket_Frame_Ping_eh4ca3_k$(data);
|
|
563
579
|
}
|
|
564
|
-
static
|
|
565
|
-
return this.
|
|
580
|
+
static new_io_ktor_websocket_Frame_Ping_eh4ca3_k$(data) {
|
|
581
|
+
return this.new_io_ktor_websocket_Frame_fjyusq_k$(true, FrameType_PING_getInstance(), data, NonDisposableHandle_instance, false, false, false);
|
|
566
582
|
}
|
|
567
583
|
}
|
|
568
584
|
class Pong extends Frame {
|
|
569
585
|
constructor(data, disposableHandle) {
|
|
570
|
-
return new.target.
|
|
586
|
+
return new.target.new_io_ktor_websocket_Frame_Pong_hee4xw_k$(data, disposableHandle);
|
|
571
587
|
}
|
|
572
|
-
static
|
|
588
|
+
static new_io_ktor_websocket_Frame_Pong_hee4xw_k$(data, disposableHandle) {
|
|
573
589
|
disposableHandle = disposableHandle === VOID ? NonDisposableHandle_instance : disposableHandle;
|
|
574
|
-
return this.
|
|
590
|
+
return this.new_io_ktor_websocket_Frame_fjyusq_k$(true, FrameType_PONG_getInstance(), data, disposableHandle, false, false, false);
|
|
575
591
|
}
|
|
576
592
|
}
|
|
577
|
-
class
|
|
593
|
+
class Companion_6 {
|
|
578
594
|
constructor() {
|
|
579
|
-
|
|
580
|
-
this.
|
|
595
|
+
Companion_instance_7 = this;
|
|
596
|
+
this.Empty_1 = new Int8Array(0);
|
|
581
597
|
}
|
|
582
|
-
|
|
598
|
+
byType_2g4m5x_k$(fin, frameType, data, rsv1, rsv2, rsv3) {
|
|
583
599
|
var tmp;
|
|
584
|
-
switch (frameType.
|
|
600
|
+
switch (frameType.ordinal_1) {
|
|
585
601
|
case 1:
|
|
586
|
-
tmp = Binary.
|
|
602
|
+
tmp = Binary.new_io_ktor_websocket_Frame_Binary_yf73xr_k$(fin, data, rsv1, rsv2, rsv3);
|
|
587
603
|
break;
|
|
588
604
|
case 0:
|
|
589
|
-
tmp = Text.
|
|
605
|
+
tmp = Text.new_io_ktor_websocket_Frame_Text_sv4r43_k$(fin, data, rsv1, rsv2, rsv3);
|
|
590
606
|
break;
|
|
591
607
|
case 2:
|
|
592
|
-
tmp = Close.
|
|
608
|
+
tmp = Close.new_io_ktor_websocket_Frame_Close_1zir9_k$(data);
|
|
593
609
|
break;
|
|
594
610
|
case 3:
|
|
595
|
-
tmp = Ping.
|
|
611
|
+
tmp = Ping.new_io_ktor_websocket_Frame_Ping_eh4ca3_k$(data);
|
|
596
612
|
break;
|
|
597
613
|
case 4:
|
|
598
|
-
tmp = Pong.
|
|
614
|
+
tmp = Pong.new_io_ktor_websocket_Frame_Pong_hee4xw_k$(data, NonDisposableHandle_instance);
|
|
599
615
|
break;
|
|
600
616
|
default:
|
|
601
617
|
noWhenBranchMatchedException();
|
|
@@ -605,6 +621,28 @@ class Companion_5 {
|
|
|
605
621
|
}
|
|
606
622
|
}
|
|
607
623
|
//endregion
|
|
624
|
+
var static_init_called;
|
|
625
|
+
function static_init() {
|
|
626
|
+
if (static_init_called)
|
|
627
|
+
return Unit_instance;
|
|
628
|
+
static_init_called = true;
|
|
629
|
+
Codes_NORMAL_instance = new Codes('NORMAL', 0, 1000);
|
|
630
|
+
Codes_GOING_AWAY_instance = new Codes('GOING_AWAY', 1, 1001);
|
|
631
|
+
Codes_PROTOCOL_ERROR_instance = new Codes('PROTOCOL_ERROR', 2, 1002);
|
|
632
|
+
Codes_CANNOT_ACCEPT_instance = new Codes('CANNOT_ACCEPT', 3, 1003);
|
|
633
|
+
Codes_CLOSED_ABNORMALLY_instance = new Codes('CLOSED_ABNORMALLY', 4, 1006);
|
|
634
|
+
Codes_NOT_CONSISTENT_instance = new Codes('NOT_CONSISTENT', 5, 1007);
|
|
635
|
+
Codes_VIOLATED_POLICY_instance = new Codes('VIOLATED_POLICY', 6, 1008);
|
|
636
|
+
Codes_TOO_BIG_instance = new Codes('TOO_BIG', 7, 1009);
|
|
637
|
+
Codes_NO_EXTENSION_instance = new Codes('NO_EXTENSION', 8, 1010);
|
|
638
|
+
Codes_INTERNAL_ERROR_instance = new Codes('INTERNAL_ERROR', 9, 1011);
|
|
639
|
+
Codes_SERVICE_RESTART_instance = new Codes('SERVICE_RESTART', 10, 1012);
|
|
640
|
+
Codes_TRY_AGAIN_LATER_instance = new Codes('TRY_AGAIN_LATER', 11, 1013);
|
|
641
|
+
if (Companion_instance_0 === VOID) {
|
|
642
|
+
Companion_instance;
|
|
643
|
+
new Companion();
|
|
644
|
+
}
|
|
645
|
+
}
|
|
608
646
|
var Codes_NORMAL_instance;
|
|
609
647
|
var Codes_GOING_AWAY_instance;
|
|
610
648
|
var Codes_PROTOCOL_ERROR_instance;
|
|
@@ -617,89 +655,109 @@ var Codes_NO_EXTENSION_instance;
|
|
|
617
655
|
var Codes_INTERNAL_ERROR_instance;
|
|
618
656
|
var Codes_SERVICE_RESTART_instance;
|
|
619
657
|
var Codes_TRY_AGAIN_LATER_instance;
|
|
620
|
-
var
|
|
658
|
+
var Companion_instance_0;
|
|
621
659
|
function Companion_getInstance() {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
new Companion();
|
|
625
|
-
return Companion_instance;
|
|
660
|
+
static_init();
|
|
661
|
+
return Companion_instance_0;
|
|
626
662
|
}
|
|
627
663
|
function values() {
|
|
664
|
+
static_init();
|
|
628
665
|
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()];
|
|
629
666
|
}
|
|
630
667
|
function get_entries() {
|
|
668
|
+
static_init();
|
|
631
669
|
if ($ENTRIES == null)
|
|
632
670
|
$ENTRIES = enumEntries(values());
|
|
633
671
|
return $ENTRIES;
|
|
634
672
|
}
|
|
635
|
-
var Codes_entriesInitialized;
|
|
636
|
-
function Codes_initEntries() {
|
|
637
|
-
if (Codes_entriesInitialized)
|
|
638
|
-
return Unit_instance;
|
|
639
|
-
Codes_entriesInitialized = true;
|
|
640
|
-
Codes_NORMAL_instance = new Codes('NORMAL', 0, 1000);
|
|
641
|
-
Codes_GOING_AWAY_instance = new Codes('GOING_AWAY', 1, 1001);
|
|
642
|
-
Codes_PROTOCOL_ERROR_instance = new Codes('PROTOCOL_ERROR', 2, 1002);
|
|
643
|
-
Codes_CANNOT_ACCEPT_instance = new Codes('CANNOT_ACCEPT', 3, 1003);
|
|
644
|
-
Codes_CLOSED_ABNORMALLY_instance = new Codes('CLOSED_ABNORMALLY', 4, 1006);
|
|
645
|
-
Codes_NOT_CONSISTENT_instance = new Codes('NOT_CONSISTENT', 5, 1007);
|
|
646
|
-
Codes_VIOLATED_POLICY_instance = new Codes('VIOLATED_POLICY', 6, 1008);
|
|
647
|
-
Codes_TOO_BIG_instance = new Codes('TOO_BIG', 7, 1009);
|
|
648
|
-
Codes_NO_EXTENSION_instance = new Codes('NO_EXTENSION', 8, 1010);
|
|
649
|
-
Codes_INTERNAL_ERROR_instance = new Codes('INTERNAL_ERROR', 9, 1011);
|
|
650
|
-
Codes_SERVICE_RESTART_instance = new Codes('SERVICE_RESTART', 10, 1012);
|
|
651
|
-
Codes_TRY_AGAIN_LATER_instance = new Codes('TRY_AGAIN_LATER', 11, 1013);
|
|
652
|
-
Companion_getInstance();
|
|
653
|
-
}
|
|
654
673
|
var $ENTRIES;
|
|
674
|
+
var Companion_instance_1;
|
|
675
|
+
function Companion_getInstance_0() {
|
|
676
|
+
return Companion_instance_1;
|
|
677
|
+
}
|
|
655
678
|
function Codes_NORMAL_getInstance() {
|
|
656
|
-
|
|
679
|
+
static_init();
|
|
657
680
|
return Codes_NORMAL_instance;
|
|
658
681
|
}
|
|
659
682
|
function Codes_GOING_AWAY_getInstance() {
|
|
660
|
-
|
|
683
|
+
static_init();
|
|
661
684
|
return Codes_GOING_AWAY_instance;
|
|
662
685
|
}
|
|
663
686
|
function Codes_PROTOCOL_ERROR_getInstance() {
|
|
664
|
-
|
|
687
|
+
static_init();
|
|
665
688
|
return Codes_PROTOCOL_ERROR_instance;
|
|
666
689
|
}
|
|
667
690
|
function Codes_CANNOT_ACCEPT_getInstance() {
|
|
668
|
-
|
|
691
|
+
static_init();
|
|
669
692
|
return Codes_CANNOT_ACCEPT_instance;
|
|
670
693
|
}
|
|
671
694
|
function Codes_CLOSED_ABNORMALLY_getInstance() {
|
|
672
|
-
|
|
695
|
+
static_init();
|
|
673
696
|
return Codes_CLOSED_ABNORMALLY_instance;
|
|
674
697
|
}
|
|
675
698
|
function Codes_NOT_CONSISTENT_getInstance() {
|
|
676
|
-
|
|
699
|
+
static_init();
|
|
677
700
|
return Codes_NOT_CONSISTENT_instance;
|
|
678
701
|
}
|
|
679
702
|
function Codes_VIOLATED_POLICY_getInstance() {
|
|
680
|
-
|
|
703
|
+
static_init();
|
|
681
704
|
return Codes_VIOLATED_POLICY_instance;
|
|
682
705
|
}
|
|
683
706
|
function Codes_TOO_BIG_getInstance() {
|
|
684
|
-
|
|
707
|
+
static_init();
|
|
685
708
|
return Codes_TOO_BIG_instance;
|
|
686
709
|
}
|
|
687
710
|
function Codes_NO_EXTENSION_getInstance() {
|
|
688
|
-
|
|
711
|
+
static_init();
|
|
689
712
|
return Codes_NO_EXTENSION_instance;
|
|
690
713
|
}
|
|
691
714
|
function Codes_INTERNAL_ERROR_getInstance() {
|
|
692
|
-
|
|
715
|
+
static_init();
|
|
693
716
|
return Codes_INTERNAL_ERROR_instance;
|
|
694
717
|
}
|
|
695
718
|
function Codes_SERVICE_RESTART_getInstance() {
|
|
696
|
-
|
|
719
|
+
static_init();
|
|
697
720
|
return Codes_SERVICE_RESTART_instance;
|
|
698
721
|
}
|
|
699
722
|
function Codes_TRY_AGAIN_LATER_getInstance() {
|
|
700
|
-
|
|
723
|
+
static_init();
|
|
701
724
|
return Codes_TRY_AGAIN_LATER_instance;
|
|
702
725
|
}
|
|
726
|
+
function utf8Size(_this__u8e3s4) {
|
|
727
|
+
var size = 0;
|
|
728
|
+
var index = 0;
|
|
729
|
+
while (index < _this__u8e3s4.length) {
|
|
730
|
+
var bytes = utf8ByteCountAt(_this__u8e3s4, index);
|
|
731
|
+
size = size + bytes | 0;
|
|
732
|
+
index = index + (bytes === 4 ? 2 : 1) | 0;
|
|
733
|
+
}
|
|
734
|
+
return size;
|
|
735
|
+
}
|
|
736
|
+
function utf8Truncate(_this__u8e3s4, maxSize) {
|
|
737
|
+
var size = 0;
|
|
738
|
+
var index = 0;
|
|
739
|
+
$l$loop: while (index < _this__u8e3s4.length) {
|
|
740
|
+
var bytes = utf8ByteCountAt(_this__u8e3s4, index);
|
|
741
|
+
if ((size + bytes | 0) > maxSize)
|
|
742
|
+
break $l$loop;
|
|
743
|
+
size = size + bytes | 0;
|
|
744
|
+
index = index + (bytes === 4 ? 2 : 1) | 0;
|
|
745
|
+
}
|
|
746
|
+
return index === _this__u8e3s4.length ? _this__u8e3s4 : substring(_this__u8e3s4, 0, index);
|
|
747
|
+
}
|
|
748
|
+
function utf8ByteCountAt(_this__u8e3s4, index) {
|
|
749
|
+
// Inline function 'kotlin.code' call
|
|
750
|
+
var this_0 = charCodeAt(_this__u8e3s4, index);
|
|
751
|
+
var code = Char__toInt_impl_vasixd(this_0);
|
|
752
|
+
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;
|
|
753
|
+
}
|
|
754
|
+
function validateSize(_this__u8e3s4) {
|
|
755
|
+
// Inline function 'kotlin.require' call
|
|
756
|
+
if (!(!_this__u8e3s4.frameType_1.controlFrame_1 || _this__u8e3s4.data_1.length <= 125)) {
|
|
757
|
+
var message = 'Control frames must not exceed 125 bytes per RFC 6455, ' + ('but ' + _this__u8e3s4.frameType_1.toString() + ' frame has ' + _this__u8e3s4.data_1.length + ' bytes');
|
|
758
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
759
|
+
}
|
|
760
|
+
}
|
|
703
761
|
function get_LOGGER() {
|
|
704
762
|
_init_properties_DefaultWebSocketSession_kt__469s0y();
|
|
705
763
|
return LOGGER;
|
|
@@ -724,33 +782,33 @@ var OUTGOING_CHANNEL_CONFIG;
|
|
|
724
782
|
function DefaultWebSocketSession_0(session, pingIntervalMillis, timeoutMillis, channelsConfig) {
|
|
725
783
|
pingIntervalMillis = pingIntervalMillis === VOID ? 0n : pingIntervalMillis;
|
|
726
784
|
timeoutMillis = timeoutMillis === VOID ? 15000n : timeoutMillis;
|
|
727
|
-
channelsConfig = channelsConfig === VOID ? Companion_getInstance_2().
|
|
785
|
+
channelsConfig = channelsConfig === VOID ? Companion_getInstance_2().UNLIMITED_1 : channelsConfig;
|
|
728
786
|
_init_properties_DefaultWebSocketSession_kt__469s0y();
|
|
729
787
|
// Inline function 'kotlin.require' call
|
|
730
788
|
if (!!isInterface(session, DefaultWebSocketSession)) {
|
|
731
789
|
var message = 'Cannot wrap other DefaultWebSocketSession';
|
|
732
|
-
throw IllegalArgumentException.
|
|
790
|
+
throw IllegalArgumentException.new_kotlin_IllegalArgumentException_sfqr8_k$(toString(message));
|
|
733
791
|
}
|
|
734
|
-
return new DefaultWebSocketSessionImpl(session, pingIntervalMillis, timeoutMillis, channelsConfig.
|
|
792
|
+
return new DefaultWebSocketSessionImpl(session, pingIntervalMillis, timeoutMillis, channelsConfig.incoming_1, channelsConfig.outgoing_1);
|
|
735
793
|
}
|
|
736
794
|
function runIncomingProcessor($this, ponger) {
|
|
737
|
-
var tmp = get_IncomingProcessorCoroutineName().
|
|
795
|
+
var tmp = get_IncomingProcessorCoroutineName().plus_s13ygv_k$(Dispatchers_getInstance().Unconfined_1);
|
|
738
796
|
return launch($this, tmp, VOID, DefaultWebSocketSessionImpl$runIncomingProcessor$slambda($this, ponger));
|
|
739
797
|
}
|
|
740
798
|
function runOutgoingProcessor($this) {
|
|
741
|
-
var tmp = get_OutgoingProcessorCoroutineName().
|
|
799
|
+
var tmp = get_OutgoingProcessorCoroutineName().plus_s13ygv_k$(Dispatchers_getInstance().Unconfined_1);
|
|
742
800
|
var tmp_0 = CoroutineStart_UNDISPATCHED_getInstance();
|
|
743
801
|
return launch($this, tmp, tmp_0, DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda($this));
|
|
744
802
|
}
|
|
745
803
|
function *outgoingProcessorLoop($this, $completion) {
|
|
746
|
-
var _iterator__ex2g4s = $this.
|
|
747
|
-
$l$loop: while (yield* _iterator__ex2g4s.
|
|
748
|
-
var frame = _iterator__ex2g4s.
|
|
804
|
+
var _iterator__ex2g4s = $this.outgoingToBeProcessed_1.iterator_jk1svi_k$();
|
|
805
|
+
$l$loop: while (yield* _iterator__ex2g4s.hasNext_nhy1w3_k$($completion)) {
|
|
806
|
+
var frame = _iterator__ex2g4s.next_20eer_k$();
|
|
749
807
|
// Inline function 'io.ktor.util.logging.trace' call
|
|
750
808
|
var this_0 = get_LOGGER();
|
|
751
809
|
if (get_isTraceEnabled(this_0)) {
|
|
752
810
|
var tmp$ret$1 = 'Sending ' + frame.toString() + ' from session ' + toString($this);
|
|
753
|
-
this_0.
|
|
811
|
+
this_0.trace_fti9bv_k$(tmp$ret$1);
|
|
754
812
|
}
|
|
755
813
|
var tmp;
|
|
756
814
|
if (frame instanceof Close) {
|
|
@@ -770,7 +828,7 @@ function *outgoingProcessorLoop($this, $completion) {
|
|
|
770
828
|
}
|
|
771
829
|
}
|
|
772
830
|
var processedFrame = tmp;
|
|
773
|
-
yield* $this.
|
|
831
|
+
yield* $this.raw_1.get_outgoing_us7o3v_k$().send_44jogj_k$(processedFrame, $completion);
|
|
774
832
|
}
|
|
775
833
|
return Unit_instance;
|
|
776
834
|
}
|
|
@@ -782,165 +840,165 @@ function *sendCloseSequence($this, reason, exception, $completion) {
|
|
|
782
840
|
var this_0 = get_LOGGER();
|
|
783
841
|
if (get_isTraceEnabled(this_0)) {
|
|
784
842
|
var tmp$ret$1 = 'Sending Close Sequence for session ' + toString($this) + ' with reason ' + toString_0(reason) + ' and exception ' + toString_0(exception);
|
|
785
|
-
this_0.
|
|
843
|
+
this_0.trace_fti9bv_k$(tmp$ret$1);
|
|
786
844
|
}
|
|
787
|
-
$this.
|
|
788
|
-
var reasonToSend = reason == null ? CloseReason.
|
|
845
|
+
$this.context_1.complete_9ww6vb_k$();
|
|
846
|
+
var reasonToSend = reason == null ? CloseReason.new_io_ktor_websocket_CloseReason_al0vxu_k$(Codes_NORMAL_getInstance(), '') : reason;
|
|
789
847
|
try {
|
|
790
848
|
runOrCancelPinger($this);
|
|
791
|
-
if (!(reasonToSend.
|
|
792
|
-
yield* $this.
|
|
849
|
+
if (!(reasonToSend.code_1 === Codes_CLOSED_ABNORMALLY_getInstance().code_1)) {
|
|
850
|
+
yield* $this.raw_1.get_outgoing_us7o3v_k$().send_44jogj_k$(Close.new_io_ktor_websocket_Frame_Close_zgly5v_k$(reasonToSend), $completion);
|
|
793
851
|
}
|
|
794
852
|
}finally {
|
|
795
|
-
$this.
|
|
853
|
+
$this.closeReasonRef_1.complete_ixf84q_k$(reasonToSend);
|
|
796
854
|
if (!(exception == null)) {
|
|
797
|
-
$this.
|
|
798
|
-
$this.
|
|
855
|
+
$this.outgoingToBeProcessed_1.close_ukldxa_k$(exception);
|
|
856
|
+
$this.filtered_1.close_ukldxa_k$(exception);
|
|
799
857
|
}
|
|
800
858
|
}
|
|
801
859
|
return Unit_instance;
|
|
802
860
|
}
|
|
803
861
|
function tryClose($this) {
|
|
804
|
-
return $this.
|
|
862
|
+
return $this.closed_1.atomicfu$compareAndSet(false, true);
|
|
805
863
|
}
|
|
806
864
|
function runOrCancelPinger($this) {
|
|
807
|
-
var interval = $this.
|
|
865
|
+
var interval = $this.pingIntervalMillis_1;
|
|
808
866
|
var tmp;
|
|
809
|
-
if ($this.
|
|
867
|
+
if ($this.closed_1.kotlinx$atomicfu$value) {
|
|
810
868
|
tmp = null;
|
|
811
869
|
} else if (interval > 0n) {
|
|
812
|
-
var tmp_0 = $this.
|
|
813
|
-
var tmp_1 = $this.
|
|
870
|
+
var tmp_0 = $this.raw_1.get_outgoing_us7o3v_k$();
|
|
871
|
+
var tmp_1 = $this.timeoutMillis_1;
|
|
814
872
|
tmp = pinger($this, tmp_0, interval, tmp_1, DefaultWebSocketSessionImpl$runOrCancelPinger$slambda($this));
|
|
815
873
|
} else {
|
|
816
874
|
tmp = null;
|
|
817
875
|
}
|
|
818
876
|
var newPinger = tmp;
|
|
819
|
-
var tmp0_safe_receiver = $this.
|
|
877
|
+
var tmp0_safe_receiver = $this.pinger_1.atomicfu$getAndSet(newPinger);
|
|
820
878
|
if (tmp0_safe_receiver == null)
|
|
821
879
|
null;
|
|
822
880
|
else
|
|
823
|
-
tmp0_safe_receiver.
|
|
824
|
-
var tmp2_safe_receiver = newPinger == null ? null : new ChannelResult(newPinger.
|
|
881
|
+
tmp0_safe_receiver.close$default_kcbl7u_k$();
|
|
882
|
+
var tmp2_safe_receiver = newPinger == null ? null : new ChannelResult(newPinger.trySend_62dpg8_k$(Companion_getInstance_1().EmptyPong_1));
|
|
825
883
|
if (tmp2_safe_receiver == null)
|
|
826
884
|
null;
|
|
827
885
|
else
|
|
828
|
-
_ChannelResult___get_isSuccess__impl__odq1z9(tmp2_safe_receiver.
|
|
829
|
-
if ($this.
|
|
886
|
+
_ChannelResult___get_isSuccess__impl__odq1z9(tmp2_safe_receiver.holder_1);
|
|
887
|
+
if ($this.closed_1.kotlinx$atomicfu$value && !(newPinger == null)) {
|
|
830
888
|
runOrCancelPinger($this);
|
|
831
889
|
}
|
|
832
890
|
}
|
|
833
891
|
function *checkMaxFrameSize($this, packet, frame, $completion) {
|
|
834
|
-
var tmp = frame.
|
|
892
|
+
var tmp = frame.data_1.length;
|
|
835
893
|
var tmp1_elvis_lhs = packet == null ? null : get_size(packet);
|
|
836
894
|
var size = tmp + (tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs) | 0;
|
|
837
|
-
if (fromInt(size) > $this.
|
|
895
|
+
if (fromInt(size) > $this.get_maxFrameSize_9zaht9_k$()) {
|
|
838
896
|
if (packet == null)
|
|
839
897
|
null;
|
|
840
898
|
else {
|
|
841
|
-
packet.
|
|
899
|
+
packet.close_yn9xrc_k$();
|
|
842
900
|
}
|
|
843
|
-
yield* close($this, CloseReason.
|
|
844
|
-
throw FrameTooBigException.
|
|
901
|
+
yield* close($this, CloseReason.new_io_ktor_websocket_CloseReason_al0vxu_k$(Codes_TOO_BIG_getInstance(), 'Frame is too big: ' + size + '. Max size is ' + $this.get_maxFrameSize_9zaht9_k$().toString()), $completion);
|
|
902
|
+
throw FrameTooBigException.new_io_ktor_websocket_FrameTooBigException_7tb0yi_k$(fromInt(size));
|
|
845
903
|
}
|
|
846
904
|
return Unit_instance;
|
|
847
905
|
}
|
|
848
906
|
function processIncomingExtensions($this, frame) {
|
|
849
907
|
// Inline function 'kotlin.collections.fold' call
|
|
850
908
|
var accumulator = frame;
|
|
851
|
-
var _iterator__ex2g4s = $this.
|
|
852
|
-
while (_iterator__ex2g4s.
|
|
853
|
-
var element = _iterator__ex2g4s.
|
|
909
|
+
var _iterator__ex2g4s = $this.get_extensions_kxksyl_k$().iterator_jk1svi_k$();
|
|
910
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
911
|
+
var element = _iterator__ex2g4s.next_20eer_k$();
|
|
854
912
|
var current = accumulator;
|
|
855
|
-
accumulator = element.
|
|
913
|
+
accumulator = element.processIncomingFrame_lcwqbj_k$(current);
|
|
856
914
|
}
|
|
857
915
|
return accumulator;
|
|
858
916
|
}
|
|
859
917
|
function processOutgoingExtensions($this, frame) {
|
|
860
918
|
// Inline function 'kotlin.collections.fold' call
|
|
861
919
|
var accumulator = frame;
|
|
862
|
-
var _iterator__ex2g4s = $this.
|
|
863
|
-
while (_iterator__ex2g4s.
|
|
864
|
-
var element = _iterator__ex2g4s.
|
|
920
|
+
var _iterator__ex2g4s = $this.get_extensions_kxksyl_k$().iterator_jk1svi_k$();
|
|
921
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
922
|
+
var element = _iterator__ex2g4s.next_20eer_k$();
|
|
865
923
|
var current = accumulator;
|
|
866
|
-
accumulator = element.
|
|
924
|
+
accumulator = element.processOutgoingFrame_8xceij_k$(current);
|
|
867
925
|
}
|
|
868
926
|
return accumulator;
|
|
869
927
|
}
|
|
870
|
-
var
|
|
871
|
-
function
|
|
872
|
-
if (
|
|
873
|
-
new
|
|
874
|
-
return
|
|
928
|
+
var Companion_instance_2;
|
|
929
|
+
function Companion_getInstance_1() {
|
|
930
|
+
if (Companion_instance_2 === VOID)
|
|
931
|
+
new Companion_1();
|
|
932
|
+
return Companion_instance_2;
|
|
875
933
|
}
|
|
876
934
|
function DefaultWebSocketSessionImpl$start$slambda($incomingJob, $outgoingJob, this$0) {
|
|
877
|
-
return constructCallableReference(
|
|
878
|
-
yield* $incomingJob.
|
|
879
|
-
yield* $outgoingJob.
|
|
880
|
-
this$0.
|
|
935
|
+
return constructCallableReference(($this$launch, $completion) => orPromise($completion, function *($completion) {
|
|
936
|
+
yield* $incomingJob.join_o20dar_k$($completion);
|
|
937
|
+
yield* $outgoingJob.join_o20dar_k$($completion);
|
|
938
|
+
this$0.context_1.cancel$default_8haxne_k$();
|
|
881
939
|
return Unit_instance;
|
|
882
|
-
}, 1);
|
|
940
|
+
}), 1);
|
|
883
941
|
}
|
|
884
942
|
function DefaultWebSocketSessionImpl$runIncomingProcessor$slambda(this$0, $ponger) {
|
|
885
|
-
return constructCallableReference(
|
|
943
|
+
return constructCallableReference(($this$launch, $completion) => orPromise($completion, function *($completion) {
|
|
886
944
|
var firstFrame = null;
|
|
887
945
|
var frameBody = null;
|
|
888
946
|
var closeFramePresented = false;
|
|
889
947
|
try {
|
|
890
948
|
// Inline function 'kotlinx.coroutines.channels.consumeEach' call
|
|
891
|
-
var tmp0 = this$0.
|
|
949
|
+
var tmp0 = this$0.raw_1.get_incoming_u9os29_k$();
|
|
892
950
|
$l$block_1: {
|
|
893
951
|
// Inline function 'kotlinx.coroutines.channels.consume' call
|
|
894
952
|
var cause = null;
|
|
895
953
|
try {
|
|
896
|
-
var _iterator__ex2g4s = tmp0.
|
|
897
|
-
while (yield* _iterator__ex2g4s.
|
|
898
|
-
var e = _iterator__ex2g4s.
|
|
954
|
+
var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
|
|
955
|
+
while (yield* _iterator__ex2g4s.hasNext_nhy1w3_k$($completion)) {
|
|
956
|
+
var e = _iterator__ex2g4s.next_20eer_k$();
|
|
899
957
|
$l$block_0: {
|
|
900
958
|
// Inline function 'io.ktor.util.logging.trace' call
|
|
901
959
|
var this_0 = get_LOGGER();
|
|
902
960
|
if (get_isTraceEnabled(this_0)) {
|
|
903
961
|
var tmp$ret$5 = 'WebSocketSession(' + toString($this$launch) + ') receiving frame ' + e.toString();
|
|
904
|
-
this_0.
|
|
962
|
+
this_0.trace_fti9bv_k$(tmp$ret$5);
|
|
905
963
|
}
|
|
906
964
|
if (e instanceof Close) {
|
|
907
|
-
if (!this$0.
|
|
908
|
-
var tmp = this$0.
|
|
965
|
+
if (!this$0.get_outgoing_us7o3v_k$().get_isClosedForSend_ajczci_k$()) {
|
|
966
|
+
var tmp = this$0.get_outgoing_us7o3v_k$();
|
|
909
967
|
var tmp1_elvis_lhs = readReason(e);
|
|
910
|
-
yield* tmp.
|
|
968
|
+
yield* tmp.send_44jogj_k$(Close.new_io_ktor_websocket_Frame_Close_zgly5v_k$(tmp1_elvis_lhs == null ? get_NORMAL_CLOSE() : tmp1_elvis_lhs), $completion);
|
|
911
969
|
}
|
|
912
970
|
closeFramePresented = true;
|
|
913
971
|
return Unit_instance;
|
|
914
972
|
} else {
|
|
915
973
|
if (e instanceof Pong) {
|
|
916
|
-
var tmp2_safe_receiver = this$0.
|
|
974
|
+
var tmp2_safe_receiver = this$0.pinger_1.kotlinx$atomicfu$value;
|
|
917
975
|
if (tmp2_safe_receiver == null)
|
|
918
976
|
null;
|
|
919
977
|
else
|
|
920
|
-
yield* tmp2_safe_receiver.
|
|
978
|
+
yield* tmp2_safe_receiver.send_44jogj_k$(e, $completion);
|
|
921
979
|
} else {
|
|
922
980
|
if (e instanceof Ping)
|
|
923
|
-
yield* $ponger.
|
|
981
|
+
yield* $ponger.send_44jogj_k$(e, $completion);
|
|
924
982
|
else {
|
|
925
983
|
yield* /*#__NOINLINE__*/checkMaxFrameSize(this$0, frameBody, e, $completion);
|
|
926
|
-
if (!e.
|
|
984
|
+
if (!e.fin_1) {
|
|
927
985
|
if (firstFrame == null) {
|
|
928
986
|
firstFrame = e;
|
|
929
987
|
}
|
|
930
988
|
if (frameBody == null) {
|
|
931
989
|
frameBody = BytePacketBuilder();
|
|
932
990
|
}
|
|
933
|
-
writeFully(frameBody, e.
|
|
991
|
+
writeFully(frameBody, e.data_1);
|
|
934
992
|
break $l$block_0;
|
|
935
993
|
}
|
|
936
994
|
if (firstFrame == null) {
|
|
937
|
-
yield* this$0.
|
|
995
|
+
yield* this$0.filtered_1.send_44jogj_k$(processIncomingExtensions(this$0, e), $completion);
|
|
938
996
|
break $l$block_0;
|
|
939
997
|
}
|
|
940
|
-
writeFully(ensureNotNull(frameBody), e.
|
|
941
|
-
var defragmented = Companion_getInstance_5().
|
|
998
|
+
writeFully(ensureNotNull(frameBody), e.data_1);
|
|
999
|
+
var defragmented = Companion_getInstance_5().byType_2g4m5x_k$(true, firstFrame.frameType_1, readByteArray(build(frameBody)), firstFrame.rsv1__1, firstFrame.rsv2__1, firstFrame.rsv3__1);
|
|
942
1000
|
firstFrame = null;
|
|
943
|
-
yield* this$0.
|
|
1001
|
+
yield* this$0.filtered_1.send_44jogj_k$(processIncomingExtensions(this$0, defragmented), $completion);
|
|
944
1002
|
}
|
|
945
1003
|
}
|
|
946
1004
|
}
|
|
@@ -966,31 +1024,31 @@ function DefaultWebSocketSessionImpl$runIncomingProcessor$slambda(this$0, $ponge
|
|
|
966
1024
|
} else {
|
|
967
1025
|
if ($p_0 instanceof Error) {
|
|
968
1026
|
var cause_0 = $p_0;
|
|
969
|
-
$ponger.
|
|
970
|
-
this$0.
|
|
1027
|
+
$ponger.close$default_kcbl7u_k$();
|
|
1028
|
+
this$0.filtered_1.close_ukldxa_k$(cause_0);
|
|
971
1029
|
} else {
|
|
972
1030
|
throw $p_0;
|
|
973
1031
|
}
|
|
974
1032
|
}
|
|
975
1033
|
}
|
|
976
1034
|
finally {
|
|
977
|
-
$ponger.
|
|
1035
|
+
$ponger.close$default_kcbl7u_k$();
|
|
978
1036
|
var tmp0_safe_receiver = frameBody;
|
|
979
1037
|
if (tmp0_safe_receiver == null)
|
|
980
1038
|
null;
|
|
981
1039
|
else {
|
|
982
|
-
tmp0_safe_receiver.
|
|
1040
|
+
tmp0_safe_receiver.close_yn9xrc_k$();
|
|
983
1041
|
}
|
|
984
|
-
this$0.
|
|
1042
|
+
this$0.filtered_1.close$default_kcbl7u_k$();
|
|
985
1043
|
if (!closeFramePresented) {
|
|
986
|
-
yield* close(this$0, CloseReason.
|
|
1044
|
+
yield* close(this$0, CloseReason.new_io_ktor_websocket_CloseReason_al0vxu_k$(Codes_CLOSED_ABNORMALLY_getInstance(), 'Connection was closed without close frame'), $completion);
|
|
987
1045
|
}
|
|
988
1046
|
}
|
|
989
1047
|
return Unit_instance;
|
|
990
|
-
}, 1);
|
|
1048
|
+
}), 1);
|
|
991
1049
|
}
|
|
992
1050
|
function DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda(this$0) {
|
|
993
|
-
return constructCallableReference(
|
|
1051
|
+
return constructCallableReference(($this$launch, $completion) => orPromise($completion, function *($completion) {
|
|
994
1052
|
var tmp;
|
|
995
1053
|
try {
|
|
996
1054
|
tmp = yield* /*#__NOINLINE__*/outgoingProcessorLoop(this$0, $completion);
|
|
@@ -1006,7 +1064,7 @@ function DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda(this$0) {
|
|
|
1006
1064
|
} else {
|
|
1007
1065
|
if ($p instanceof CancellationException) {
|
|
1008
1066
|
var _unused_var__etf5q3_1 = $p;
|
|
1009
|
-
tmp_0 = yield* /*#__NOINLINE__*/sendCloseSequence(this$0, CloseReason.
|
|
1067
|
+
tmp_0 = yield* /*#__NOINLINE__*/sendCloseSequence(this$0, CloseReason.new_io_ktor_websocket_CloseReason_al0vxu_k$(Codes_NORMAL_getInstance(), ''), VOID, $completion);
|
|
1010
1068
|
} else {
|
|
1011
1069
|
if ($p instanceof ChannelIOException) {
|
|
1012
1070
|
var _unused_var__etf5q3_2 = $p;
|
|
@@ -1014,8 +1072,8 @@ function DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda(this$0) {
|
|
|
1014
1072
|
} else {
|
|
1015
1073
|
if ($p instanceof Error) {
|
|
1016
1074
|
var cause = $p;
|
|
1017
|
-
this$0.
|
|
1018
|
-
yield* closeExceptionally(this$0.
|
|
1075
|
+
this$0.outgoingToBeProcessed_1.cancel_hkmm2i_k$(CancellationException.new_kotlin_coroutines_cancellation_CancellationException_cpsifs_k$('Failed to send frame', cause));
|
|
1076
|
+
yield* closeExceptionally(this$0.raw_1, cause, $completion);
|
|
1019
1077
|
return Unit_instance;
|
|
1020
1078
|
} else {
|
|
1021
1079
|
throw $p;
|
|
@@ -1027,17 +1085,17 @@ function DefaultWebSocketSessionImpl$runOutgoingProcessor$slambda(this$0) {
|
|
|
1027
1085
|
tmp = tmp_0;
|
|
1028
1086
|
}
|
|
1029
1087
|
finally {
|
|
1030
|
-
this$0.
|
|
1031
|
-
yield* close(this$0.
|
|
1088
|
+
this$0.outgoingToBeProcessed_1.cancel$default_880p35_k$();
|
|
1089
|
+
yield* close(this$0.raw_1, VOID, $completion);
|
|
1032
1090
|
}
|
|
1033
1091
|
return Unit_instance;
|
|
1034
|
-
}, 1);
|
|
1092
|
+
}), 1);
|
|
1035
1093
|
}
|
|
1036
1094
|
function DefaultWebSocketSessionImpl$runOrCancelPinger$slambda(this$0) {
|
|
1037
|
-
return constructCallableReference(
|
|
1038
|
-
yield* /*#__NOINLINE__*/sendCloseSequence(this$0, it, IOException.
|
|
1095
|
+
return constructCallableReference((it, $completion) => orPromise($completion, function *($completion) {
|
|
1096
|
+
yield* /*#__NOINLINE__*/sendCloseSequence(this$0, it, IOException.new_kotlinx_io_IOException_wvwdyo_k$('Ping timeout'), $completion);
|
|
1039
1097
|
return Unit_instance;
|
|
1040
|
-
}, 1);
|
|
1098
|
+
}), 1);
|
|
1041
1099
|
}
|
|
1042
1100
|
var properties_initialized_DefaultWebSocketSession_kt_6cjlhc;
|
|
1043
1101
|
function _init_properties_DefaultWebSocketSession_kt__469s0y() {
|
|
@@ -1046,7 +1104,7 @@ function _init_properties_DefaultWebSocketSession_kt__469s0y() {
|
|
|
1046
1104
|
LOGGER = KtorSimpleLogger('io.ktor.websocket.WebSocket');
|
|
1047
1105
|
IncomingProcessorCoroutineName = new CoroutineName('ws-incoming-processor');
|
|
1048
1106
|
OutgoingProcessorCoroutineName = new CoroutineName('ws-outgoing-processor');
|
|
1049
|
-
NORMAL_CLOSE = CloseReason.
|
|
1107
|
+
NORMAL_CLOSE = CloseReason.new_io_ktor_websocket_CloseReason_al0vxu_k$(Codes_NORMAL_getInstance(), 'OK');
|
|
1050
1108
|
var tmp0_safe_receiver = get_OUTGOING_CHANNEL_CAPACITY();
|
|
1051
1109
|
var tmp;
|
|
1052
1110
|
if (tmp0_safe_receiver == null) {
|
|
@@ -1059,72 +1117,71 @@ function _init_properties_DefaultWebSocketSession_kt__469s0y() {
|
|
|
1059
1117
|
}
|
|
1060
1118
|
}
|
|
1061
1119
|
function readReason(_this__u8e3s4) {
|
|
1062
|
-
if (_this__u8e3s4.
|
|
1120
|
+
if (_this__u8e3s4.data_1.length < 2) {
|
|
1063
1121
|
return null;
|
|
1064
1122
|
}
|
|
1065
1123
|
// Inline function 'io.ktor.utils.io.core.buildPacket' call
|
|
1066
1124
|
var builder = new Buffer();
|
|
1067
|
-
writeFully(builder, _this__u8e3s4.
|
|
1125
|
+
writeFully(builder, _this__u8e3s4.data_1);
|
|
1068
1126
|
var packet = builder;
|
|
1069
|
-
var code = packet.
|
|
1127
|
+
var code = packet.readShort_ilpyey_k$();
|
|
1070
1128
|
var message = readText(packet);
|
|
1071
|
-
return CloseReason.
|
|
1129
|
+
return CloseReason.new_io_ktor_websocket_CloseReason_a5tz4j_k$(code, message);
|
|
1072
1130
|
}
|
|
1073
1131
|
var NonDisposableHandle_instance;
|
|
1074
1132
|
function NonDisposableHandle_getInstance() {
|
|
1075
1133
|
return NonDisposableHandle_instance;
|
|
1076
1134
|
}
|
|
1135
|
+
var static_init_called_0;
|
|
1136
|
+
function static_init_0() {
|
|
1137
|
+
if (static_init_called_0)
|
|
1138
|
+
return Unit_instance;
|
|
1139
|
+
static_init_called_0 = true;
|
|
1140
|
+
FrameType_TEXT_instance = new FrameType('TEXT', 0, false, 1);
|
|
1141
|
+
FrameType_BINARY_instance = new FrameType('BINARY', 1, false, 2);
|
|
1142
|
+
FrameType_CLOSE_instance = new FrameType('CLOSE', 2, true, 8);
|
|
1143
|
+
FrameType_PING_instance = new FrameType('PING', 3, true, 9);
|
|
1144
|
+
FrameType_PONG_instance = new FrameType('PONG', 4, true, 10);
|
|
1145
|
+
if (Companion_instance_3 === VOID) {
|
|
1146
|
+
Companion_instance;
|
|
1147
|
+
new Companion_2();
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1077
1150
|
var FrameType_TEXT_instance;
|
|
1078
1151
|
var FrameType_BINARY_instance;
|
|
1079
1152
|
var FrameType_CLOSE_instance;
|
|
1080
1153
|
var FrameType_PING_instance;
|
|
1081
1154
|
var FrameType_PONG_instance;
|
|
1082
|
-
var
|
|
1083
|
-
function Companion_getInstance_1() {
|
|
1084
|
-
FrameType_initEntries();
|
|
1085
|
-
if (Companion_instance_1 === VOID)
|
|
1086
|
-
new Companion_1();
|
|
1087
|
-
return Companion_instance_1;
|
|
1088
|
-
}
|
|
1155
|
+
var Companion_instance_3;
|
|
1089
1156
|
function values_0() {
|
|
1157
|
+
static_init_0();
|
|
1090
1158
|
return [FrameType_TEXT_getInstance(), FrameType_BINARY_getInstance(), FrameType_CLOSE_getInstance(), FrameType_PING_getInstance(), FrameType_PONG_getInstance()];
|
|
1091
1159
|
}
|
|
1092
1160
|
function get_entries_0() {
|
|
1161
|
+
static_init_0();
|
|
1093
1162
|
if ($ENTRIES_0 == null)
|
|
1094
1163
|
$ENTRIES_0 = enumEntries(values_0());
|
|
1095
1164
|
return $ENTRIES_0;
|
|
1096
1165
|
}
|
|
1097
|
-
var FrameType_entriesInitialized;
|
|
1098
|
-
function FrameType_initEntries() {
|
|
1099
|
-
if (FrameType_entriesInitialized)
|
|
1100
|
-
return Unit_instance;
|
|
1101
|
-
FrameType_entriesInitialized = true;
|
|
1102
|
-
FrameType_TEXT_instance = new FrameType('TEXT', 0, false, 1);
|
|
1103
|
-
FrameType_BINARY_instance = new FrameType('BINARY', 1, false, 2);
|
|
1104
|
-
FrameType_CLOSE_instance = new FrameType('CLOSE', 2, true, 8);
|
|
1105
|
-
FrameType_PING_instance = new FrameType('PING', 3, true, 9);
|
|
1106
|
-
FrameType_PONG_instance = new FrameType('PONG', 4, true, 10);
|
|
1107
|
-
Companion_getInstance_1();
|
|
1108
|
-
}
|
|
1109
1166
|
var $ENTRIES_0;
|
|
1110
1167
|
function FrameType_TEXT_getInstance() {
|
|
1111
|
-
|
|
1168
|
+
static_init_0();
|
|
1112
1169
|
return FrameType_TEXT_instance;
|
|
1113
1170
|
}
|
|
1114
1171
|
function FrameType_BINARY_getInstance() {
|
|
1115
|
-
|
|
1172
|
+
static_init_0();
|
|
1116
1173
|
return FrameType_BINARY_instance;
|
|
1117
1174
|
}
|
|
1118
1175
|
function FrameType_CLOSE_getInstance() {
|
|
1119
|
-
|
|
1176
|
+
static_init_0();
|
|
1120
1177
|
return FrameType_CLOSE_instance;
|
|
1121
1178
|
}
|
|
1122
1179
|
function FrameType_PING_getInstance() {
|
|
1123
|
-
|
|
1180
|
+
static_init_0();
|
|
1124
1181
|
return FrameType_PING_instance;
|
|
1125
1182
|
}
|
|
1126
1183
|
function FrameType_PONG_getInstance() {
|
|
1127
|
-
|
|
1184
|
+
static_init_0();
|
|
1128
1185
|
return FrameType_PONG_instance;
|
|
1129
1186
|
}
|
|
1130
1187
|
function get_PongerCoroutineName() {
|
|
@@ -1148,14 +1205,14 @@ function pinger(_this__u8e3s4, outgoing, periodMillis, timeoutMillis, onTimeout)
|
|
|
1148
1205
|
_init_properties_PingPong_kt__9aqxey();
|
|
1149
1206
|
var actorJob = Job();
|
|
1150
1207
|
var channel = Channel(2147483647);
|
|
1151
|
-
var tmp = actorJob.
|
|
1208
|
+
var tmp = actorJob.plus_s13ygv_k$(get_PingerCoroutineName());
|
|
1152
1209
|
launch(_this__u8e3s4, tmp, VOID, pinger$slambda(periodMillis, timeoutMillis, onTimeout, channel, outgoing));
|
|
1153
|
-
var tmp_0 = ensureNotNull(_this__u8e3s4.
|
|
1154
|
-
tmp_0.
|
|
1210
|
+
var tmp_0 = ensureNotNull(_this__u8e3s4.get_coroutineContext_115oqo_k$().get_y2st91_k$(Key_instance));
|
|
1211
|
+
tmp_0.invokeOnCompletion_n6cffu_k$(pinger$lambda(actorJob));
|
|
1155
1212
|
return channel;
|
|
1156
1213
|
}
|
|
1157
1214
|
function ponger$slambda($channel, $outgoing) {
|
|
1158
|
-
return constructCallableReference(
|
|
1215
|
+
return constructCallableReference(($this$launch, $completion) => orPromise($completion, function *($completion) {
|
|
1159
1216
|
var tmp;
|
|
1160
1217
|
try {
|
|
1161
1218
|
// Inline function 'kotlinx.coroutines.channels.consumeEach' call
|
|
@@ -1164,11 +1221,11 @@ function ponger$slambda($channel, $outgoing) {
|
|
|
1164
1221
|
// Inline function 'kotlinx.coroutines.channels.consume' call
|
|
1165
1222
|
var cause = null;
|
|
1166
1223
|
try {
|
|
1167
|
-
var _iterator__ex2g4s = tmp0.
|
|
1168
|
-
while (yield* _iterator__ex2g4s.
|
|
1169
|
-
var e = _iterator__ex2g4s.
|
|
1170
|
-
get_LOGGER().
|
|
1171
|
-
yield* $outgoing.
|
|
1224
|
+
var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
|
|
1225
|
+
while (yield* _iterator__ex2g4s.hasNext_nhy1w3_k$($completion)) {
|
|
1226
|
+
var e = _iterator__ex2g4s.next_20eer_k$();
|
|
1227
|
+
get_LOGGER().trace_fti9bv_k$('Received ping message, sending pong message');
|
|
1228
|
+
yield* $outgoing.send_44jogj_k$(Pong.new_io_ktor_websocket_Frame_Pong_hee4xw_k$(e.data_1), $completion);
|
|
1172
1229
|
}
|
|
1173
1230
|
break $l$block;
|
|
1174
1231
|
} catch ($p) {
|
|
@@ -1196,46 +1253,61 @@ function ponger$slambda($channel, $outgoing) {
|
|
|
1196
1253
|
tmp = tmp_0;
|
|
1197
1254
|
}
|
|
1198
1255
|
return Unit_instance;
|
|
1199
|
-
}, 1);
|
|
1256
|
+
}), 1);
|
|
1200
1257
|
}
|
|
1201
1258
|
function pinger$slambda$slambda($channel) {
|
|
1202
|
-
return constructCallableReference(
|
|
1259
|
+
return constructCallableReference(($this$withTimeoutOrNull, $completion) => orPromise($completion, function *($completion) {
|
|
1203
1260
|
while (true) {
|
|
1204
|
-
yield* $channel.
|
|
1261
|
+
yield* $channel.receive_awoumx_k$($completion);
|
|
1205
1262
|
}
|
|
1206
1263
|
return Unit_instance;
|
|
1207
|
-
}, 1);
|
|
1264
|
+
}), 1);
|
|
1208
1265
|
}
|
|
1209
1266
|
function pinger$slambda$slambda_0($outgoing, $pingMessage, $channel) {
|
|
1210
|
-
return constructCallableReference(
|
|
1211
|
-
get_LOGGER().
|
|
1212
|
-
yield* $outgoing.
|
|
1267
|
+
return constructCallableReference(($this$withTimeoutOrNull, $completion) => orPromise($completion, function *($completion) {
|
|
1268
|
+
get_LOGGER().trace_fti9bv_k$('WebSocket Pinger: sending ping frame');
|
|
1269
|
+
yield* $outgoing.send_44jogj_k$(Ping.new_io_ktor_websocket_Frame_Ping_eh4ca3_k$(toByteArray($pingMessage, Charsets_getInstance().ISO_8859_1__1)), $completion);
|
|
1213
1270
|
$l$loop: while (true) {
|
|
1214
|
-
var msg = yield* $channel.
|
|
1215
|
-
if (decodeToString(msg.
|
|
1216
|
-
|
|
1271
|
+
var msg = yield* $channel.receive_awoumx_k$($completion);
|
|
1272
|
+
if (decodeToString(msg.data_1, 0, 0 + msg.data_1.length | 0) === $pingMessage) {
|
|
1273
|
+
// Inline function 'io.ktor.util.logging.trace' call
|
|
1274
|
+
var this_0 = get_LOGGER();
|
|
1275
|
+
if (get_isTraceEnabled(this_0)) {
|
|
1276
|
+
var tmp$ret$1 = 'WebSocket Pinger: received valid pong frame ' + msg.toString();
|
|
1277
|
+
this_0.trace_fti9bv_k$(tmp$ret$1);
|
|
1278
|
+
}
|
|
1217
1279
|
break $l$loop;
|
|
1218
1280
|
}
|
|
1219
|
-
|
|
1281
|
+
// Inline function 'io.ktor.util.logging.trace' call
|
|
1282
|
+
var this_1 = get_LOGGER();
|
|
1283
|
+
if (get_isTraceEnabled(this_1)) {
|
|
1284
|
+
var tmp$ret$3 = 'WebSocket Pinger: received invalid pong frame ' + msg.toString() + ', continue waiting';
|
|
1285
|
+
this_1.trace_fti9bv_k$(tmp$ret$3);
|
|
1286
|
+
}
|
|
1220
1287
|
}
|
|
1221
1288
|
return Unit_instance;
|
|
1222
|
-
}, 1);
|
|
1289
|
+
}), 1);
|
|
1223
1290
|
}
|
|
1224
1291
|
function pinger$slambda($periodMillis, $timeoutMillis, $onTimeout, $channel, $outgoing) {
|
|
1225
|
-
return constructCallableReference(
|
|
1226
|
-
|
|
1292
|
+
return constructCallableReference(($this$launch, $completion) => orPromise($completion, function *($completion) {
|
|
1293
|
+
// Inline function 'io.ktor.util.logging.trace' call
|
|
1294
|
+
var this_0 = get_LOGGER();
|
|
1295
|
+
if (get_isTraceEnabled(this_0)) {
|
|
1296
|
+
var tmp$ret$1 = 'Starting WebSocket pinger coroutine with period ' + $periodMillis.toString() + ' ms and timeout ' + $timeoutMillis.toString() + ' ms';
|
|
1297
|
+
this_0.trace_fti9bv_k$(tmp$ret$1);
|
|
1298
|
+
}
|
|
1227
1299
|
var random = Random(getTimeMillis());
|
|
1228
1300
|
var pingIdBytes = new Int8Array(32);
|
|
1229
1301
|
var tmp;
|
|
1230
1302
|
try {
|
|
1231
1303
|
$l$loop: while (true) {
|
|
1232
1304
|
yield* withTimeoutOrNull($periodMillis, pinger$slambda$slambda($channel), $completion);
|
|
1233
|
-
random.
|
|
1305
|
+
random.nextBytes_ln07bs_k$(pingIdBytes);
|
|
1234
1306
|
var pingMessage = '[ping ' + toHexString(pingIdBytes) + ' ping]';
|
|
1235
1307
|
var rc = yield* withTimeoutOrNull($timeoutMillis, pinger$slambda$slambda_0($outgoing, pingMessage, $channel), $completion);
|
|
1236
1308
|
if (rc == null) {
|
|
1237
|
-
get_LOGGER().
|
|
1238
|
-
yield* $onTimeout(CloseReason.
|
|
1309
|
+
get_LOGGER().trace_fti9bv_k$('WebSocket pinger has timed out');
|
|
1310
|
+
yield* $($onTimeout(CloseReason.new_io_ktor_websocket_CloseReason_al0vxu_k$(Codes_INTERNAL_ERROR_getInstance(), 'Ping timeout'), $completion), $completion);
|
|
1239
1311
|
break $l$loop;
|
|
1240
1312
|
}
|
|
1241
1313
|
}
|
|
@@ -1266,11 +1338,11 @@ function pinger$slambda($periodMillis, $timeoutMillis, $onTimeout, $channel, $ou
|
|
|
1266
1338
|
tmp = tmp_0;
|
|
1267
1339
|
}
|
|
1268
1340
|
return Unit_instance;
|
|
1269
|
-
}, 1);
|
|
1341
|
+
}), 1);
|
|
1270
1342
|
}
|
|
1271
1343
|
function pinger$lambda($actorJob) {
|
|
1272
1344
|
return (it) => {
|
|
1273
|
-
$actorJob.
|
|
1345
|
+
$actorJob.cancel$default_8haxne_k$();
|
|
1274
1346
|
return Unit_instance;
|
|
1275
1347
|
};
|
|
1276
1348
|
}
|
|
@@ -1282,44 +1354,44 @@ function _init_properties_PingPong_kt__9aqxey() {
|
|
|
1282
1354
|
PingerCoroutineName = new CoroutineName('ws-pinger');
|
|
1283
1355
|
}
|
|
1284
1356
|
}
|
|
1285
|
-
var
|
|
1357
|
+
var Companion_instance_4;
|
|
1286
1358
|
function Companion_getInstance_2() {
|
|
1287
|
-
if (
|
|
1288
|
-
new
|
|
1289
|
-
return
|
|
1359
|
+
if (Companion_instance_4 === VOID)
|
|
1360
|
+
new Companion_3();
|
|
1361
|
+
return Companion_instance_4;
|
|
1290
1362
|
}
|
|
1291
1363
|
function from(_this__u8e3s4, config) {
|
|
1292
1364
|
// Inline function 'kotlin.with' call
|
|
1293
1365
|
var tmp;
|
|
1294
|
-
if (config.
|
|
1366
|
+
if (config.capacity_1 === 2147483647) {
|
|
1295
1367
|
tmp = Channel(2147483647);
|
|
1296
|
-
} else if (config.
|
|
1297
|
-
tmp = Channel(config.
|
|
1298
|
-
} else if (config.
|
|
1299
|
-
tmp = new BoundedChannel(config.
|
|
1368
|
+
} else if (config.onOverflow_1.equals(ChannelOverflow_SUSPEND_getInstance())) {
|
|
1369
|
+
tmp = Channel(config.capacity_1, BufferOverflow_SUSPEND_getInstance());
|
|
1370
|
+
} else if (config.onOverflow_1.equals(ChannelOverflow_CLOSE_getInstance())) {
|
|
1371
|
+
tmp = new BoundedChannel(config.capacity_1);
|
|
1300
1372
|
} else {
|
|
1301
1373
|
// Inline function 'kotlin.error' call
|
|
1302
1374
|
var message = 'Unsupported channel config.';
|
|
1303
|
-
throw IllegalStateException.
|
|
1375
|
+
throw IllegalStateException.new_kotlin_IllegalStateException_w47ei6_k$(toString(message));
|
|
1304
1376
|
}
|
|
1305
1377
|
return tmp;
|
|
1306
1378
|
}
|
|
1307
|
-
var
|
|
1379
|
+
var Companion_instance_5;
|
|
1308
1380
|
function Companion_getInstance_3() {
|
|
1309
|
-
if (
|
|
1310
|
-
new
|
|
1311
|
-
return
|
|
1381
|
+
if (Companion_instance_5 === VOID)
|
|
1382
|
+
new Companion_4();
|
|
1383
|
+
return Companion_instance_5;
|
|
1312
1384
|
}
|
|
1313
|
-
var
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
function ChannelOverflow_initEntries() {
|
|
1317
|
-
if (ChannelOverflow_entriesInitialized)
|
|
1385
|
+
var static_init_called_1;
|
|
1386
|
+
function static_init_1() {
|
|
1387
|
+
if (static_init_called_1)
|
|
1318
1388
|
return Unit_instance;
|
|
1319
|
-
|
|
1389
|
+
static_init_called_1 = true;
|
|
1320
1390
|
ChannelOverflow_SUSPEND_instance = new ChannelOverflow('SUSPEND', 0);
|
|
1321
1391
|
ChannelOverflow_CLOSE_instance = new ChannelOverflow('CLOSE', 1);
|
|
1322
1392
|
}
|
|
1393
|
+
var ChannelOverflow_SUSPEND_instance;
|
|
1394
|
+
var ChannelOverflow_CLOSE_instance;
|
|
1323
1395
|
function BoundedChannel$Companion$createDelegate$lambda($channel) {
|
|
1324
1396
|
return (it) => {
|
|
1325
1397
|
var tmp;
|
|
@@ -1329,42 +1401,42 @@ function BoundedChannel$Companion$createDelegate$lambda($channel) {
|
|
|
1329
1401
|
} else {
|
|
1330
1402
|
tmp_0 = $channel._v;
|
|
1331
1403
|
}
|
|
1332
|
-
if (!tmp_0.
|
|
1404
|
+
if (!tmp_0.get_isClosedForSend_ajczci_k$()) {
|
|
1333
1405
|
var tmp_1;
|
|
1334
1406
|
if ($channel._v == null) {
|
|
1335
1407
|
throwUninitializedPropertyAccessException('channel');
|
|
1336
1408
|
} else {
|
|
1337
1409
|
tmp_1 = $channel._v;
|
|
1338
1410
|
}
|
|
1339
|
-
tmp_1.
|
|
1411
|
+
tmp_1.close_ukldxa_k$(ChannelOverflowException.new_io_ktor_websocket_ChannelOverflowException_hoqwtd_k$('Channel overflowed'));
|
|
1340
1412
|
tmp = Unit_instance;
|
|
1341
1413
|
}
|
|
1342
1414
|
return Unit_instance;
|
|
1343
1415
|
};
|
|
1344
1416
|
}
|
|
1345
|
-
var
|
|
1417
|
+
var Companion_instance_6;
|
|
1346
1418
|
function Companion_getInstance_4() {
|
|
1347
|
-
return
|
|
1419
|
+
return Companion_instance_6;
|
|
1348
1420
|
}
|
|
1349
1421
|
function ChannelOverflow_SUSPEND_getInstance() {
|
|
1350
|
-
|
|
1422
|
+
static_init_1();
|
|
1351
1423
|
return ChannelOverflow_SUSPEND_instance;
|
|
1352
1424
|
}
|
|
1353
1425
|
function ChannelOverflow_CLOSE_getInstance() {
|
|
1354
|
-
|
|
1426
|
+
static_init_1();
|
|
1355
1427
|
return ChannelOverflow_CLOSE_instance;
|
|
1356
1428
|
}
|
|
1357
1429
|
function parametersToString($this) {
|
|
1358
|
-
return $this.
|
|
1430
|
+
return $this.parameters_1.isEmpty_y1axqb_k$() ? '' : '; ' + joinToString($this.parameters_1, ';');
|
|
1359
1431
|
}
|
|
1360
1432
|
function parseWebSocketExtensions(value) {
|
|
1361
1433
|
// Inline function 'kotlin.collections.map' call
|
|
1362
1434
|
var this_0 = split(value, [',']);
|
|
1363
1435
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1364
|
-
var destination = ArrayList.
|
|
1365
|
-
var _iterator__ex2g4s = this_0.
|
|
1366
|
-
while (_iterator__ex2g4s.
|
|
1367
|
-
var item = _iterator__ex2g4s.
|
|
1436
|
+
var destination = ArrayList.new_kotlin_collections_ArrayList_tdd6ob_k$(collectionSizeOrDefault(this_0, 10));
|
|
1437
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
1438
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
1439
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
1368
1440
|
var extension = split(item, [';']);
|
|
1369
1441
|
// Inline function 'kotlin.text.trim' call
|
|
1370
1442
|
var this_1 = first(extension);
|
|
@@ -1372,25 +1444,25 @@ function parseWebSocketExtensions(value) {
|
|
|
1372
1444
|
// Inline function 'kotlin.collections.map' call
|
|
1373
1445
|
var this_2 = drop(extension, 1);
|
|
1374
1446
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1375
|
-
var destination_0 = ArrayList.
|
|
1376
|
-
var _iterator__ex2g4s_0 = this_2.
|
|
1377
|
-
while (_iterator__ex2g4s_0.
|
|
1378
|
-
var item_0 = _iterator__ex2g4s_0.
|
|
1447
|
+
var destination_0 = ArrayList.new_kotlin_collections_ArrayList_tdd6ob_k$(collectionSizeOrDefault(this_2, 10));
|
|
1448
|
+
var _iterator__ex2g4s_0 = this_2.iterator_jk1svi_k$();
|
|
1449
|
+
while (_iterator__ex2g4s_0.hasNext_bitz1p_k$()) {
|
|
1450
|
+
var item_0 = _iterator__ex2g4s_0.next_20eer_k$();
|
|
1379
1451
|
// Inline function 'kotlin.text.trim' call
|
|
1380
1452
|
var tmp$ret$6 = toString(trim(isCharSequence(item_0) ? item_0 : THROW_CCE()));
|
|
1381
|
-
destination_0.
|
|
1453
|
+
destination_0.add_utx5q5_k$(tmp$ret$6);
|
|
1382
1454
|
}
|
|
1383
1455
|
var parameters = destination_0;
|
|
1384
1456
|
var tmp$ret$2 = new WebSocketExtensionHeader(name, parameters);
|
|
1385
|
-
destination.
|
|
1457
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
1386
1458
|
}
|
|
1387
1459
|
return destination;
|
|
1388
1460
|
}
|
|
1389
1461
|
function *close(_this__u8e3s4, reason, $completion) {
|
|
1390
|
-
reason = reason === VOID ? CloseReason.
|
|
1462
|
+
reason = reason === VOID ? CloseReason.new_io_ktor_websocket_CloseReason_al0vxu_k$(Codes_NORMAL_getInstance(), '') : reason;
|
|
1391
1463
|
try {
|
|
1392
|
-
yield* _this__u8e3s4.
|
|
1393
|
-
yield* _this__u8e3s4.
|
|
1464
|
+
yield* _this__u8e3s4.send_sburzs_k$(Close.new_io_ktor_websocket_Frame_Close_zgly5v_k$(reason), $completion);
|
|
1465
|
+
yield* _this__u8e3s4.flush_4wsz1p_k$($completion);
|
|
1394
1466
|
} catch ($p) {
|
|
1395
1467
|
if ($p instanceof Error) {
|
|
1396
1468
|
var _unused_var__etf5q3 = $p;
|
|
@@ -1403,19 +1475,20 @@ function *close(_this__u8e3s4, reason, $completion) {
|
|
|
1403
1475
|
function *closeExceptionally(_this__u8e3s4, cause, $completion) {
|
|
1404
1476
|
var tmp;
|
|
1405
1477
|
if (cause instanceof CancellationException) {
|
|
1406
|
-
tmp = CloseReason.
|
|
1478
|
+
tmp = CloseReason.new_io_ktor_websocket_CloseReason_al0vxu_k$(Codes_NORMAL_getInstance(), '');
|
|
1407
1479
|
} else {
|
|
1408
|
-
|
|
1480
|
+
var message = utf8Truncate(cause.toString(), 123);
|
|
1481
|
+
tmp = CloseReason.new_io_ktor_websocket_CloseReason_al0vxu_k$(Codes_INTERNAL_ERROR_getInstance(), message);
|
|
1409
1482
|
}
|
|
1410
1483
|
var reason = tmp;
|
|
1411
1484
|
yield* /*#__NOINLINE__*/close(_this__u8e3s4, reason, $completion);
|
|
1412
1485
|
return Unit_instance;
|
|
1413
1486
|
}
|
|
1414
|
-
var
|
|
1487
|
+
var Companion_instance_7;
|
|
1415
1488
|
function Companion_getInstance_5() {
|
|
1416
|
-
if (
|
|
1417
|
-
new
|
|
1418
|
-
return
|
|
1489
|
+
if (Companion_instance_7 === VOID)
|
|
1490
|
+
new Companion_6();
|
|
1491
|
+
return Companion_instance_7;
|
|
1419
1492
|
}
|
|
1420
1493
|
function get_OUTGOING_CHANNEL_CAPACITY() {
|
|
1421
1494
|
return OUTGOING_CHANNEL_CAPACITY;
|
|
@@ -1424,24 +1497,25 @@ var OUTGOING_CHANNEL_CAPACITY;
|
|
|
1424
1497
|
//region block: post-declaration
|
|
1425
1498
|
initMetadataForCompanion(Companion);
|
|
1426
1499
|
initMetadataForClass(Codes, 'Codes');
|
|
1500
|
+
initMetadataForCompanion(Companion_0);
|
|
1427
1501
|
initMetadataForClass(CloseReason, 'CloseReason');
|
|
1428
1502
|
initMetadataForInterface(WebSocketSession, 'WebSocketSession', VOID, VOID, VOID, [1, 0]);
|
|
1429
1503
|
initMetadataForInterface(DefaultWebSocketSession, 'DefaultWebSocketSession', VOID, VOID, [WebSocketSession], [1, 0]);
|
|
1430
|
-
initMetadataForCompanion(
|
|
1431
|
-
protoOf(DefaultWebSocketSessionImpl).
|
|
1504
|
+
initMetadataForCompanion(Companion_1);
|
|
1505
|
+
protoOf(DefaultWebSocketSessionImpl).send_sburzs_k$ = send;
|
|
1432
1506
|
initMetadataForClass(DefaultWebSocketSessionImpl, 'DefaultWebSocketSessionImpl', VOID, VOID, [DefaultWebSocketSession, WebSocketSession], [1, 0, 2]);
|
|
1433
1507
|
initMetadataForObject(NonDisposableHandle, 'NonDisposableHandle', VOID, VOID, [DisposableHandle]);
|
|
1434
1508
|
initMetadataForClass(FrameTooBigException, 'FrameTooBigException', VOID, VOID, [CopyableThrowable]);
|
|
1435
|
-
initMetadataForCompanion(Companion_1);
|
|
1436
|
-
initMetadataForClass(FrameType, 'FrameType');
|
|
1437
1509
|
initMetadataForCompanion(Companion_2);
|
|
1438
|
-
initMetadataForClass(
|
|
1510
|
+
initMetadataForClass(FrameType, 'FrameType');
|
|
1439
1511
|
initMetadataForCompanion(Companion_3);
|
|
1512
|
+
initMetadataForClass(WebSocketChannelsConfig, 'WebSocketChannelsConfig', WebSocketChannelsConfig);
|
|
1513
|
+
initMetadataForCompanion(Companion_4);
|
|
1440
1514
|
initMetadataForClass(ChannelConfig, 'ChannelConfig');
|
|
1441
1515
|
initMetadataForClass(ChannelOverflow, 'ChannelOverflow');
|
|
1442
|
-
initMetadataForCompanion(
|
|
1443
|
-
protoOf(BoundedChannel).
|
|
1444
|
-
protoOf(BoundedChannel).
|
|
1516
|
+
initMetadataForCompanion(Companion_5);
|
|
1517
|
+
protoOf(BoundedChannel).close$default_kcbl7u_k$ = close$default;
|
|
1518
|
+
protoOf(BoundedChannel).cancel$default_880p35_k$ = cancel$default;
|
|
1445
1519
|
initMetadataForClass(BoundedChannel, 'BoundedChannel', VOID, VOID, [SendChannel, ReceiveChannel], [1, 0]);
|
|
1446
1520
|
initMetadataForClass(ChannelOverflowException, 'ChannelOverflowException');
|
|
1447
1521
|
initMetadataForInterface(WebSocketExtension, 'WebSocketExtension');
|
|
@@ -1450,23 +1524,24 @@ initMetadataForClass(WebSocketExtensionHeader, 'WebSocketExtensionHeader');
|
|
|
1450
1524
|
initMetadataForClass(Frame, 'Frame');
|
|
1451
1525
|
initMetadataForClass(Binary, 'Binary');
|
|
1452
1526
|
initMetadataForClass(Text, 'Text');
|
|
1453
|
-
initMetadataForClass(Close, 'Close', Close.
|
|
1527
|
+
initMetadataForClass(Close, 'Close', Close.new_io_ktor_websocket_Frame_Close_ddsmnf_k$);
|
|
1454
1528
|
initMetadataForClass(Ping, 'Ping');
|
|
1455
1529
|
initMetadataForClass(Pong, 'Pong');
|
|
1456
|
-
initMetadataForCompanion(
|
|
1530
|
+
initMetadataForCompanion(Companion_6);
|
|
1457
1531
|
//endregion
|
|
1458
1532
|
//region block: init
|
|
1533
|
+
Companion_instance_1 = new Companion_0();
|
|
1459
1534
|
NonDisposableHandle_instance = new NonDisposableHandle();
|
|
1460
|
-
|
|
1535
|
+
Companion_instance_6 = new Companion_5();
|
|
1461
1536
|
OUTGOING_CHANNEL_CAPACITY = null;
|
|
1462
1537
|
//endregion
|
|
1463
1538
|
//region block: exports
|
|
1464
1539
|
export {
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
send as
|
|
1540
|
+
Codes_CLOSED_ABNORMALLY_getInstance as Codes_CLOSED_ABNORMALLY_getInstance1bzb878jpjbg8,
|
|
1541
|
+
Codes_NORMAL_getInstance as Codes_NORMAL_getInstance3dr9ood98owg7,
|
|
1542
|
+
Companion_getInstance as Companion_getInstance34aryltzqunru,
|
|
1543
|
+
Companion_getInstance_2 as Companion_getInstance1pwau9pkopj,
|
|
1544
|
+
send as send1afreql7wqu1y,
|
|
1470
1545
|
CloseReason as CloseReason10cphaqpp3ct7,
|
|
1471
1546
|
DefaultWebSocketSession_0 as DefaultWebSocketSessionmehckluw85jl,
|
|
1472
1547
|
DefaultWebSocketSession as DefaultWebSocketSession3h8506yqzs5fx,
|