1[
2 {"type":"Keyword","value":"use"},
3 {"type":"Text","value":" "},
4 {"type":"LiteralString","value":"\"net\""},
5 {"type":"Text","value":"\n"},
6 {"type":"Keyword","value":"use"},
7 {"type":"Text","value":" "},
8 {"type":"LiteralString","value":"\"files\""},
9 {"type":"Text","value":"\n\n"},
10 {"type":"Keyword","value":"class"},
11 {"type":"Text","value":" "},
12 {"type":"NameClass","value":"ClientSide"},
13 {"type":"Text","value":" "},
14 {"type":"OperatorWord","value":"is"},
15 {"type":"Text","value":" "},
16 {"type":"NameClass","value":"TCPConnectionNotify"},
17 {"type":"Text","value":"\n "},
18 {"type":"Keyword","value":"let"},
19 {"type":"Text","value":" "},
20 {"type":"Name","value":"_env"},
21 {"type":"Punctuation","value":":"},
22 {"type":"Text","value":" "},
23 {"type":"KeywordType","value":"Env"},
24 {"type":"Text","value":"\n\n "},
25 {"type":"Keyword","value":"new"},
26 {"type":"Text","value":" "},
27 {"type":"Keyword","value":"iso"},
28 {"type":"Text","value":" "},
29 {"type":"NameFunction","value":"create"},
30 {"type":"Punctuation","value":"("},
31 {"type":"Name","value":"env"},
32 {"type":"Punctuation","value":":"},
33 {"type":"Text","value":" "},
34 {"type":"KeywordType","value":"Env"},
35 {"type":"Punctuation","value":")"},
36 {"type":"Text","value":" "},
37 {"type":"Punctuation","value":"=\u003e"},
38 {"type":"Text","value":"\n "},
39 {"type":"Name","value":"_env"},
40 {"type":"Text","value":" "},
41 {"type":"Operator","value":"="},
42 {"type":"Text","value":" "},
43 {"type":"Name","value":"env"},
44 {"type":"Text","value":"\n\n "},
45 {"type":"Keyword","value":"fun"},
46 {"type":"Text","value":" "},
47 {"type":"Keyword","value":"ref"},
48 {"type":"Text","value":" "},
49 {"type":"NameFunction","value":"connecting"},
50 {"type":"Punctuation","value":"("},
51 {"type":"Name","value":"conn"},
52 {"type":"Punctuation","value":":"},
53 {"type":"Text","value":" "},
54 {"type":"NameClass","value":"TCPConnection"},
55 {"type":"Text","value":" "},
56 {"type":"Keyword","value":"ref"},
57 {"type":"Punctuation","value":","},
58 {"type":"Text","value":" "},
59 {"type":"Name","value":"count"},
60 {"type":"Punctuation","value":":"},
61 {"type":"Text","value":" "},
62 {"type":"KeywordType","value":"U32"},
63 {"type":"Punctuation","value":")"},
64 {"type":"Text","value":" "},
65 {"type":"Punctuation","value":"=\u003e"},
66 {"type":"Text","value":"\n "},
67 {"type":"Name","value":"_env"},
68 {"type":"Punctuation","value":"."},
69 {"type":"Name","value":"out"},
70 {"type":"Punctuation","value":"."},
71 {"type":"Name","value":"print"},
72 {"type":"Punctuation","value":"("},
73 {"type":"LiteralString","value":"\"connecting: \""},
74 {"type":"Text","value":" "},
75 {"type":"Operator","value":"+"},
76 {"type":"Text","value":" "},
77 {"type":"Name","value":"count"},
78 {"type":"Punctuation","value":"."},
79 {"type":"NameOther","value":"string()"},
80 {"type":"Punctuation","value":")"},
81 {"type":"Text","value":"\n\n "},
82 {"type":"Keyword","value":"fun"},
83 {"type":"Text","value":" "},
84 {"type":"Keyword","value":"ref"},
85 {"type":"Text","value":" "},
86 {"type":"NameFunction","value":"connected"},
87 {"type":"Punctuation","value":"("},
88 {"type":"Name","value":"conn"},
89 {"type":"Punctuation","value":":"},
90 {"type":"Text","value":" "},
91 {"type":"NameClass","value":"TCPConnection"},
92 {"type":"Text","value":" "},
93 {"type":"Keyword","value":"ref"},
94 {"type":"Punctuation","value":")"},
95 {"type":"Text","value":" "},
96 {"type":"Punctuation","value":"=\u003e"},
97 {"type":"Text","value":"\n "},
98 {"type":"Keyword","value":"try"},
99 {"type":"Text","value":"\n "},
100 {"type":"Punctuation","value":"("},
101 {"type":"Keyword","value":"let"},
102 {"type":"Text","value":" "},
103 {"type":"Name","value":"host"},
104 {"type":"Punctuation","value":","},
105 {"type":"Text","value":" "},
106 {"type":"Keyword","value":"let"},
107 {"type":"Text","value":" "},
108 {"type":"Name","value":"service"},
109 {"type":"Punctuation","value":")"},
110 {"type":"Text","value":" "},
111 {"type":"Operator","value":"="},
112 {"type":"Text","value":" "},
113 {"type":"Name","value":"conn"},
114 {"type":"Punctuation","value":"."},
115 {"type":"Name","value":"remote_address"},
116 {"type":"Punctuation","value":"()."},
117 {"type":"Name","value":"name"},
118 {"type":"Punctuation","value":"()?"},
119 {"type":"Text","value":"\n "},
120 {"type":"Name","value":"_env"},
121 {"type":"Punctuation","value":"."},
122 {"type":"Name","value":"out"},
123 {"type":"Punctuation","value":"."},
124 {"type":"Name","value":"print"},
125 {"type":"Punctuation","value":"("},
126 {"type":"LiteralString","value":"\"connected to \""},
127 {"type":"Text","value":" "},
128 {"type":"Operator","value":"+"},
129 {"type":"Text","value":" "},
130 {"type":"Name","value":"host"},
131 {"type":"Text","value":" "},
132 {"type":"Operator","value":"+"},
133 {"type":"Text","value":" "},
134 {"type":"LiteralString","value":"\":\""},
135 {"type":"Text","value":" "},
136 {"type":"Operator","value":"+"},
137 {"type":"Text","value":" "},
138 {"type":"Name","value":"service"},
139 {"type":"Punctuation","value":")"},
140 {"type":"Text","value":"\n "},
141 {"type":"Name","value":"conn"},
142 {"type":"Punctuation","value":"."},
143 {"type":"Name","value":"set_nodelay"},
144 {"type":"Punctuation","value":"("},
145 {"type":"Keyword","value":"true"},
146 {"type":"Punctuation","value":")"},
147 {"type":"Text","value":"\n "},
148 {"type":"Name","value":"conn"},
149 {"type":"Punctuation","value":"."},
150 {"type":"Name","value":"set_keepalive"},
151 {"type":"Punctuation","value":"("},
152 {"type":"LiteralNumberInteger","value":"10"},
153 {"type":"Punctuation","value":")"},
154 {"type":"Text","value":"\n "},
155 {"type":"Name","value":"conn"},
156 {"type":"Punctuation","value":"."},
157 {"type":"Name","value":"write"},
158 {"type":"Punctuation","value":"("},
159 {"type":"LiteralString","value":"\"client says hi\""},
160 {"type":"Punctuation","value":")"},
161 {"type":"Text","value":"\n "},
162 {"type":"Keyword","value":"end"},
163 {"type":"Text","value":"\n\n"},
164 {"type":"Keyword","value":"class"},
165 {"type":"Text","value":" "},
166 {"type":"NameClass","value":"Listener"},
167 {"type":"Text","value":" "},
168 {"type":"OperatorWord","value":"is"},
169 {"type":"Text","value":" "},
170 {"type":"NameClass","value":"TCPListenNotify"},
171 {"type":"Text","value":"\n "},
172 {"type":"Keyword","value":"let"},
173 {"type":"Text","value":" "},
174 {"type":"Name","value":"_env"},
175 {"type":"Punctuation","value":":"},
176 {"type":"Text","value":" "},
177 {"type":"KeywordType","value":"Env"},
178 {"type":"Text","value":"\n "},
179 {"type":"Keyword","value":"let"},
180 {"type":"Text","value":" "},
181 {"type":"Name","value":"_limit"},
182 {"type":"Punctuation","value":":"},
183 {"type":"Text","value":" "},
184 {"type":"KeywordType","value":"USize"},
185 {"type":"Text","value":"\n "},
186 {"type":"Keyword","value":"var"},
187 {"type":"Text","value":" "},
188 {"type":"Name","value":"_host"},
189 {"type":"Punctuation","value":":"},
190 {"type":"Text","value":" "},
191 {"type":"KeywordType","value":"String"},
192 {"type":"Text","value":" "},
193 {"type":"Operator","value":"="},
194 {"type":"Text","value":" "},
195 {"type":"LiteralString","value":"\"\""},
196 {"type":"Text","value":"\n "},
197 {"type":"Keyword","value":"var"},
198 {"type":"Text","value":" "},
199 {"type":"Name","value":"_count"},
200 {"type":"Punctuation","value":":"},
201 {"type":"Text","value":" "},
202 {"type":"KeywordType","value":"USize"},
203 {"type":"Text","value":" "},
204 {"type":"Operator","value":"="},
205 {"type":"Text","value":" "},
206 {"type":"LiteralNumberInteger","value":"0"},
207 {"type":"Text","value":"\n\n "},
208 {"type":"Keyword","value":"new"},
209 {"type":"Text","value":" "},
210 {"type":"NameFunction","value":"create"},
211 {"type":"Punctuation","value":"("},
212 {"type":"Name","value":"env"},
213 {"type":"Punctuation","value":":"},
214 {"type":"Text","value":" "},
215 {"type":"KeywordType","value":"Env"},
216 {"type":"Punctuation","value":","},
217 {"type":"Text","value":" "},
218 {"type":"Name","value":"limit"},
219 {"type":"Punctuation","value":":"},
220 {"type":"Text","value":" "},
221 {"type":"KeywordType","value":"USize"},
222 {"type":"Punctuation","value":")"},
223 {"type":"Text","value":" "},
224 {"type":"Punctuation","value":"=\u003e"},
225 {"type":"Text","value":"\n "},
226 {"type":"Name","value":"_env"},
227 {"type":"Text","value":" "},
228 {"type":"Operator","value":"="},
229 {"type":"Text","value":" "},
230 {"type":"Name","value":"env"},
231 {"type":"Text","value":"\n "},
232 {"type":"Name","value":"_limit"},
233 {"type":"Text","value":" "},
234 {"type":"Operator","value":"="},
235 {"type":"Text","value":" "},
236 {"type":"Name","value":"limit"},
237 {"type":"Text","value":"\n\n "},
238 {"type":"Keyword","value":"fun"},
239 {"type":"Text","value":" "},
240 {"type":"Keyword","value":"ref"},
241 {"type":"Text","value":" "},
242 {"type":"NameFunction","value":"connected"},
243 {"type":"Punctuation","value":"("},
244 {"type":"Name","value":"listen"},
245 {"type":"Punctuation","value":":"},
246 {"type":"Text","value":" "},
247 {"type":"NameClass","value":"TCPListener"},
248 {"type":"Text","value":" "},
249 {"type":"Keyword","value":"ref"},
250 {"type":"Punctuation","value":"):"},
251 {"type":"Text","value":" "},
252 {"type":"NameClass","value":"TCPConnectionNotify"},
253 {"type":"Text","value":" "},
254 {"type":"Keyword","value":"iso"},
255 {"type":"Punctuation","value":"^"},
256 {"type":"Text","value":" "},
257 {"type":"Punctuation","value":"=\u003e"},
258 {"type":"Text","value":"\n "},
259 {"type":"Keyword","value":"let"},
260 {"type":"Text","value":" "},
261 {"type":"Name","value":"env"},
262 {"type":"Text","value":" "},
263 {"type":"Operator","value":"="},
264 {"type":"Text","value":" "},
265 {"type":"Name","value":"_env"},
266 {"type":"Text","value":"\n\n "},
267 {"type":"Name","value":"_env"},
268 {"type":"Punctuation","value":"."},
269 {"type":"Name","value":"out"},
270 {"type":"Punctuation","value":"."},
271 {"type":"Name","value":"print"},
272 {"type":"Punctuation","value":"("},
273 {"type":"LiteralString","value":"\"Server starting\""},
274 {"type":"Punctuation","value":")"},
275 {"type":"Text","value":"\n\n "},
276 {"type":"Keyword","value":"let"},
277 {"type":"Text","value":" "},
278 {"type":"Name","value":"server"},
279 {"type":"Text","value":" "},
280 {"type":"Operator","value":"="},
281 {"type":"Text","value":" "},
282 {"type":"NameClass","value":"ServerSide"},
283 {"type":"Punctuation","value":"("},
284 {"type":"Name","value":"env"},
285 {"type":"Punctuation","value":")"},
286 {"type":"Text","value":"\n\n "},
287 {"type":"Name","value":"_spawn"},
288 {"type":"Punctuation","value":"("},
289 {"type":"Name","value":"listen"},
290 {"type":"Punctuation","value":")"},
291 {"type":"Text","value":"\n "},
292 {"type":"Name","value":"server"},
293 {"type":"Text","value":"\n\n "},
294 {"type":"Keyword","value":"fun"},
295 {"type":"Text","value":" "},
296 {"type":"Keyword","value":"ref"},
297 {"type":"Text","value":" "},
298 {"type":"NameFunction","value":"_spawn"},
299 {"type":"Punctuation","value":"("},
300 {"type":"Name","value":"listen"},
301 {"type":"Punctuation","value":":"},
302 {"type":"Text","value":" "},
303 {"type":"NameClass","value":"TCPListener"},
304 {"type":"Text","value":" "},
305 {"type":"Keyword","value":"ref"},
306 {"type":"Punctuation","value":")"},
307 {"type":"Text","value":" "},
308 {"type":"Punctuation","value":"=\u003e"},
309 {"type":"Text","value":"\n "},
310 {"type":"Keyword","value":"if"},
311 {"type":"Text","value":" "},
312 {"type":"Punctuation","value":"("},
313 {"type":"Name","value":"_limit"},
314 {"type":"Text","value":" "},
315 {"type":"Operator","value":"\u003e"},
316 {"type":"Text","value":" "},
317 {"type":"LiteralNumberInteger","value":"0"},
318 {"type":"Punctuation","value":")"},
319 {"type":"Text","value":" "},
320 {"type":"OperatorWord","value":"and"},
321 {"type":"Text","value":" "},
322 {"type":"Punctuation","value":"("},
323 {"type":"Name","value":"_count"},
324 {"type":"Text","value":" "},
325 {"type":"Operator","value":"\u003e="},
326 {"type":"Text","value":" "},
327 {"type":"Name","value":"_limit"},
328 {"type":"Punctuation","value":")"},
329 {"type":"Text","value":" "},
330 {"type":"Keyword","value":"then"},
331 {"type":"Text","value":"\n "},
332 {"type":"Name","value":"listen"},
333 {"type":"Punctuation","value":"."},
334 {"type":"Name","value":"dispose"},
335 {"type":"Punctuation","value":"()"},
336 {"type":"Text","value":"\n "},
337 {"type":"Keyword","value":"return"},
338 {"type":"Text","value":"\n "},
339 {"type":"Keyword","value":"end"},
340 {"type":"Text","value":"\n\n "},
341 {"type":"Name","value":"_count"},
342 {"type":"Text","value":" "},
343 {"type":"Operator","value":"="},
344 {"type":"Text","value":" "},
345 {"type":"Name","value":"_count"},
346 {"type":"Text","value":" "},
347 {"type":"Operator","value":"+"},
348 {"type":"Text","value":" "},
349 {"type":"LiteralNumberInteger","value":"1"},
350 {"type":"Text","value":"\n "},
351 {"type":"Name","value":"_env"},
352 {"type":"Punctuation","value":"."},
353 {"type":"Name","value":"out"},
354 {"type":"Punctuation","value":"."},
355 {"type":"Name","value":"print"},
356 {"type":"Punctuation","value":"("},
357 {"type":"LiteralString","value":"\"spawn \""},
358 {"type":"Text","value":" "},
359 {"type":"Operator","value":"+"},
360 {"type":"Text","value":" "},
361 {"type":"Name","value":"_count"},
362 {"type":"Punctuation","value":"."},
363 {"type":"NameOther","value":"string()"},
364 {"type":"Punctuation","value":")"},
365 {"type":"Text","value":"\n\n "},
366 {"type":"Keyword","value":"try"},
367 {"type":"Text","value":"\n "},
368 {"type":"Keyword","value":"let"},
369 {"type":"Text","value":" "},
370 {"type":"Name","value":"env"},
371 {"type":"Text","value":" "},
372 {"type":"Operator","value":"="},
373 {"type":"Text","value":" "},
374 {"type":"Name","value":"_env"},
375 {"type":"Text","value":"\n\n "},
376 {"type":"Name","value":"_env"},
377 {"type":"Punctuation","value":"."},
378 {"type":"Name","value":"out"},
379 {"type":"Punctuation","value":"."},
380 {"type":"Name","value":"print"},
381 {"type":"Punctuation","value":"("},
382 {"type":"LiteralString","value":"\"Client starting\""},
383 {"type":"Punctuation","value":")"},
384 {"type":"Text","value":"\n "},
385 {"type":"NameClass","value":"TCPConnection"},
386 {"type":"Punctuation","value":"("},
387 {"type":"Text","value":"\n "},
388 {"type":"Name","value":"_env"},
389 {"type":"Punctuation","value":"."},
390 {"type":"Name","value":"root"},
391 {"type":"Text","value":" "},
392 {"type":"OperatorWord","value":"as"},
393 {"type":"Text","value":" "},
394 {"type":"KeywordType","value":"AmbientAuth"},
395 {"type":"Punctuation","value":","},
396 {"type":"Text","value":"\n "},
397 {"type":"NameClass","value":"ClientSide"},
398 {"type":"Punctuation","value":"("},
399 {"type":"Name","value":"env"},
400 {"type":"Punctuation","value":"),"},
401 {"type":"Text","value":"\n "},
402 {"type":"Name","value":"_host"},
403 {"type":"Punctuation","value":","},
404 {"type":"Text","value":"\n "},
405 {"type":"Name","value":"_service"},
406 {"type":"Punctuation","value":")"},
407 {"type":"Text","value":"\n "},
408 {"type":"Keyword","value":"else"},
409 {"type":"Text","value":"\n "},
410 {"type":"Name","value":"_env"},
411 {"type":"Punctuation","value":"."},
412 {"type":"Name","value":"out"},
413 {"type":"Punctuation","value":"."},
414 {"type":"Name","value":"print"},
415 {"type":"Punctuation","value":"("},
416 {"type":"LiteralString","value":"\"couldn't create client side\""},
417 {"type":"Punctuation","value":")"},
418 {"type":"Text","value":"\n "},
419 {"type":"Name","value":"listen"},
420 {"type":"Punctuation","value":"."},
421 {"type":"Name","value":"close"},
422 {"type":"Punctuation","value":"()"},
423 {"type":"Text","value":"\n "},
424 {"type":"Keyword","value":"end"},
425 {"type":"Text","value":"\n\n"},
426 {"type":"Keyword","value":"actor"},
427 {"type":"Text","value":" "},
428 {"type":"NameClass","value":"Main"},
429 {"type":"Text","value":"\n "},
430 {"type":"Keyword","value":"new"},
431 {"type":"Text","value":" "},
432 {"type":"NameFunction","value":"create"},
433 {"type":"Punctuation","value":"("},
434 {"type":"Name","value":"env"},
435 {"type":"Punctuation","value":":"},
436 {"type":"Text","value":" "},
437 {"type":"KeywordType","value":"Env"},
438 {"type":"Punctuation","value":")"},
439 {"type":"Text","value":" "},
440 {"type":"Punctuation","value":"=\u003e"},
441 {"type":"Text","value":"\n "},
442 {"type":"Keyword","value":"let"},
443 {"type":"Text","value":" "},
444 {"type":"Name","value":"limit"},
445 {"type":"Text","value":" "},
446 {"type":"Operator","value":"="},
447 {"type":"Text","value":" "},
448 {"type":"Keyword","value":"try"},
449 {"type":"Text","value":"\n "},
450 {"type":"Name","value":"env"},
451 {"type":"Punctuation","value":"."},
452 {"type":"Name","value":"args"},
453 {"type":"Punctuation","value":"("},
454 {"type":"LiteralNumberInteger","value":"1"},
455 {"type":"Punctuation","value":")?."},
456 {"type":"Name","value":"usize"},
457 {"type":"Punctuation","value":"()?"},
458 {"type":"Text","value":"\n "},
459 {"type":"Keyword","value":"else"},
460 {"type":"Text","value":"\n "},
461 {"type":"LiteralNumberInteger","value":"1"},
462 {"type":"Text","value":"\n "},
463 {"type":"Keyword","value":"end"},
464 {"type":"Text","value":"\n\n "},
465 {"type":"Keyword","value":"try"},
466 {"type":"Text","value":"\n "},
467 {"type":"Keyword","value":"let"},
468 {"type":"Text","value":" "},
469 {"type":"Name","value":"auth"},
470 {"type":"Text","value":" "},
471 {"type":"Operator","value":"="},
472 {"type":"Text","value":" "},
473 {"type":"Name","value":"env"},
474 {"type":"Punctuation","value":"."},
475 {"type":"Name","value":"root"},
476 {"type":"Text","value":" "},
477 {"type":"OperatorWord","value":"as"},
478 {"type":"Text","value":" "},
479 {"type":"KeywordType","value":"AmbientAuth"},
480 {"type":"Text","value":"\n "},
481 {"type":"NameClass","value":"TCPListener"},
482 {"type":"Punctuation","value":"("},
483 {"type":"Name","value":"auth"},
484 {"type":"Punctuation","value":","},
485 {"type":"Text","value":" "},
486 {"type":"Keyword","value":"recover"},
487 {"type":"Text","value":" "},
488 {"type":"NameClass","value":"Listener"},
489 {"type":"Punctuation","value":"("},
490 {"type":"Name","value":"env"},
491 {"type":"Punctuation","value":","},
492 {"type":"Text","value":" "},
493 {"type":"Name","value":"limit"},
494 {"type":"Punctuation","value":")"},
495 {"type":"Text","value":" "},
496 {"type":"Keyword","value":"end"},
497 {"type":"Punctuation","value":")"},
498 {"type":"Text","value":"\n "},
499 {"type":"NameClass","value":"UDPSocket"},
500 {"type":"Punctuation","value":"("},
501 {"type":"Name","value":"auth"},
502 {"type":"Punctuation","value":","},
503 {"type":"Text","value":" "},
504 {"type":"Keyword","value":"recover"},
505 {"type":"Text","value":" "},
506 {"type":"NameClass","value":"Pong"},
507 {"type":"Punctuation","value":"("},
508 {"type":"Name","value":"env"},
509 {"type":"Punctuation","value":")"},
510 {"type":"Text","value":" "},
511 {"type":"Keyword","value":"end"},
512 {"type":"Punctuation","value":")"},
513 {"type":"Text","value":"\n "},
514 {"type":"Keyword","value":"else"},
515 {"type":"Text","value":"\n "},
516 {"type":"Name","value":"env"},
517 {"type":"Punctuation","value":"."},
518 {"type":"Name","value":"out"},
519 {"type":"Punctuation","value":"."},
520 {"type":"Name","value":"print"},
521 {"type":"Punctuation","value":"("},
522 {"type":"LiteralString","value":"\"unable to use the network\""},
523 {"type":"Punctuation","value":")"},
524 {"type":"Text","value":"\n "},
525 {"type":"Keyword","value":"end"},
526 {"type":"Text","value":"\n "},
527 {"type":"Keyword","value":"be"},
528 {"type":"Text","value":" "},
529 {"type":"NameFunction","value":"test"},
530 {"type":"Punctuation","value":"()"},
531 {"type":"Text","value":" "},
532 {"type":"Punctuation","value":"=\u003e"},
533 {"type":"Text","value":"\n "},
534 {"type":"Name","value":"nonsensical"},
535 {"type":"Punctuation","value":"."},
536 {"type":"Name","value":"stuff"},
537 {"type":"Punctuation","value":"."},
538 {"type":"Name","value":"here"},
539 {"type":"Punctuation","value":"()"},
540 {"type":"Text","value":"\n\n"}
541]
View as plain text