@@ -59,6 +59,24 @@ msgid ""
59
59
"\n"
60
60
"asyncio.run(tcp_echo_client('Hello World!'))"
61
61
msgstr ""
62
+ "import asyncio\n"
63
+ "\n"
64
+ "async def tcp_echo_client(message):\n"
65
+ " reader, writer = await asyncio.open_connection(\n"
66
+ " '127.0.0.1', 8888)\n"
67
+ "\n"
68
+ " print(f'Send: {message!r}')\n"
69
+ " writer.write(message.encode())\n"
70
+ " await writer.drain()\n"
71
+ "\n"
72
+ " data = await reader.read(100)\n"
73
+ " print(f'Received: {data.decode()!r}')\n"
74
+ "\n"
75
+ " print('Close the connection')\n"
76
+ " writer.close()\n"
77
+ " await writer.wait_closed()\n"
78
+ "\n"
79
+ "asyncio.run(tcp_echo_client('Hello World!'))"
62
80
63
81
#: ../../library/asyncio-stream.rst:42
64
82
msgid "See also the `Examples`_ section below."
@@ -110,9 +128,8 @@ msgid ""
110
128
msgstr ""
111
129
112
130
#: ../../library/asyncio-stream.rst:78
113
- #, fuzzy
114
131
msgid "Added the *ssl_handshake_timeout* parameter."
115
- msgstr "*ssl_handshake_timeout* 매개 변수 ."
132
+ msgstr "*ssl_handshake_timeout* 매개 변수를 추가했습니다 ."
116
133
117
134
#: ../../library/asyncio-stream.rst:81
118
135
msgid "Added the *happy_eyeballs_delay* and *interleave* parameters."
@@ -126,9 +143,8 @@ msgstr ""
126
143
#: ../../library/asyncio-stream.rst:87 ../../library/asyncio-stream.rst:131
127
144
#: ../../library/asyncio-stream.rst:167 ../../library/asyncio-stream.rst:198
128
145
#: ../../library/asyncio-stream.rst:397
129
- #, fuzzy
130
146
msgid "Added the *ssl_shutdown_timeout* parameter."
131
- msgstr "*ssl_handshake_timeout * 매개 변수 ."
147
+ msgstr "*ssl_shutdown_timeout * 매개 변수를 추가했습니다 ."
132
148
133
149
#: ../../library/asyncio-stream.rst:101
134
150
msgid "Start a socket server."
@@ -168,14 +184,12 @@ msgid ""
168
184
msgstr ""
169
185
170
186
#: ../../library/asyncio-stream.rst:125
171
- #, fuzzy
172
187
msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters."
173
- msgstr "*ssl_handshake_timeout* 와 *start_serving* 매개 변수 ."
188
+ msgstr "*ssl_handshake_timeout* 와 *start_serving* 매개 변수를 추가했습니다 ."
174
189
175
190
#: ../../library/asyncio-stream.rst:134
176
- #, fuzzy
177
191
msgid "Added the *keep_alive* parameter."
178
- msgstr "*ssl_handshake_timeout * 매개 변수 ."
192
+ msgstr "*keep_alive * 매개 변수를 추가했습니다 ."
179
193
180
194
#: ../../library/asyncio-stream.rst:139
181
195
msgid "Unix Sockets"
@@ -200,11 +214,12 @@ msgid "Availability"
200
214
msgstr "가용성"
201
215
202
216
#: ../../library/asyncio-stream.rst:160
203
- #, fuzzy
204
217
msgid ""
205
218
"Added the *ssl_handshake_timeout* parameter. The *path* parameter can now"
206
219
" be a :term:`path-like object`"
207
- msgstr "*path* 매개 변수는 이제 :term:`경로류 객체 <path-like object>`\\ 가 될 수 있습니다."
220
+ msgstr ""
221
+ "*ssl_handshake_timeout* 매개 변수를 추가했습니다. *path* 매개 변수는 이제 :term:`경로류 객체 "
222
+ "<path-like object>`\\ 가 될 수 있습니다."
208
223
209
224
#: ../../library/asyncio-stream.rst:177
210
225
msgid "Start a Unix socket server."
@@ -219,23 +234,25 @@ msgid "See also the documentation of :meth:`loop.create_unix_server`."
219
234
msgstr ":meth:`loop.create_unix_server`\\ 의 설명서도 참조하십시오."
220
235
221
236
#: ../../library/asyncio-stream.rst:191
222
- #, fuzzy
223
237
msgid ""
224
238
"Added the *ssl_handshake_timeout* and *start_serving* parameters. The "
225
239
"*path* parameter can now be a :term:`path-like object`."
226
- msgstr "*ssl_handshake_timeout* 와 *start_serving* 매개 변수."
240
+ msgstr ""
241
+ "*ssl_handshake_timeout* 와 *start_serving* 매개 변수를 추가했습니다. *path* 매개 변수는 이제"
242
+ " :term:`경로류 객체 <path-like object>`\\ 가 될 수 있습니다."
227
243
228
244
#: ../../library/asyncio-stream.rst:203
229
245
msgid "StreamReader"
230
246
msgstr "StreamReader"
231
247
232
248
#: ../../library/asyncio-stream.rst:207
233
- #, fuzzy
234
249
msgid ""
235
250
"Represents a reader object that provides APIs to read data from the IO "
236
251
"stream. As an :term:`asynchronous iterable`, the object supports the "
237
252
":keyword:`async for` statement."
238
- msgstr "IO 스트림에서 데이터를 읽는 API를 제공하는 판독기(reader) 객체를 나타냅니다."
253
+ msgstr ""
254
+ "IO 스트림에서 데이터를 읽는 API를 제공하는 판독기(reader) 객체를 나타냅니다. :term:`비동기 이터러블 "
255
+ "<asynchronous iterable>`\\ 로서, 객체는 :keyword:`async for` 문을 지원합니다."
239
256
240
257
#: ../../library/asyncio-stream.rst:211
241
258
msgid ""
@@ -254,12 +271,13 @@ msgid "Read up to *n* bytes from the stream."
254
271
msgstr ""
255
272
256
273
#: ../../library/asyncio-stream.rst:224
257
- #, fuzzy
258
274
msgid ""
259
275
"If *n* is not provided or set to ``-1``, read until EOF, then return all "
260
276
"read :class:`bytes`. If EOF was received and the internal buffer is "
261
277
"empty, return an empty ``bytes`` object."
262
- msgstr "EOF를 수신했고 내부 버퍼가 비어 있으면, 빈 ``bytes`` 객체를 반환합니다."
278
+ msgstr ""
279
+ "*n*\\ 이 제공되지 않거나 ``-1``\\ 로 설정되면, EOF까지 읽은 다음, 모든 읽어들인 :class:`bytes`\\ 를 "
280
+ "반환합니다. EOF를 수신했고 내부 버퍼가 비어 있으면, 빈 ``bytes`` 객체를 반환합니다."
263
281
264
282
#: ../../library/asyncio-stream.rst:229
265
283
msgid "If *n* is ``0``, return an empty ``bytes`` object immediately."
@@ -342,9 +360,8 @@ msgid ""
342
360
msgstr ""
343
361
344
362
#: ../../library/asyncio-stream.rst:285
345
- #, fuzzy
346
363
msgid "The *separator* parameter may now be a :class:`tuple` of separators."
347
- msgstr "*path * 매개 변수는 이제 :term:`경로류 객체 <path-like object> `\\ 가 될 수 있습니다."
364
+ msgstr "*separator * 매개 변수는 이제 구분자들의 :class:`tuple `\\ 일 수 있습니다."
348
365
349
366
#: ../../library/asyncio-stream.rst:290
350
367
msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called."
@@ -386,6 +403,8 @@ msgid ""
386
403
"stream.write(data)\n"
387
404
"await stream.drain()"
388
405
msgstr ""
406
+ "stream.write(data)\n"
407
+ "await stream.drain()"
389
408
390
409
#: ../../library/asyncio-stream.rst:319
391
410
msgid ""
@@ -401,23 +420,26 @@ msgid ""
401
420
"stream.writelines(lines)\n"
402
421
"await stream.drain()"
403
422
msgstr ""
423
+ "stream.writelines(lines)\n"
424
+ "await stream.drain()"
404
425
405
426
#: ../../library/asyncio-stream.rst:331
406
427
msgid "The method closes the stream and the underlying socket."
407
428
msgstr "이 메서드는 스트림과 하부 소켓을 닫습니다."
408
429
409
430
#: ../../library/asyncio-stream.rst:333
410
- #, fuzzy
411
431
msgid ""
412
432
"The method should be used, though not mandatory, along with the "
413
433
"``wait_closed()`` method::"
414
- msgstr "이 메서드는 ``wait_closed()`` 메서드와 함께 사용해야 합니다::"
434
+ msgstr "이 메서드는 필수는 아니지만 ``wait_closed()`` 메서드와 함께 사용해야 합니다::"
415
435
416
436
#: ../../library/asyncio-stream.rst:336
417
437
msgid ""
418
438
"stream.close()\n"
419
439
"await stream.wait_closed()"
420
440
msgstr ""
441
+ "stream.close()\n"
442
+ "await stream.wait_closed()"
421
443
422
444
#: ../../library/asyncio-stream.rst:341
423
445
msgid ""
@@ -454,6 +476,8 @@ msgid ""
454
476
"writer.write(data)\n"
455
477
"await writer.drain()"
456
478
msgstr ""
479
+ "writer.write(data)\n"
480
+ "await writer.drain()"
457
481
458
482
#: ../../library/asyncio-stream.rst:367
459
483
msgid ""
@@ -508,12 +532,13 @@ msgid "Wait until the stream is closed."
508
532
msgstr "스트림이 닫힐 때까지 기다립니다."
509
533
510
534
#: ../../library/asyncio-stream.rst:413
511
- #, fuzzy
512
535
msgid ""
513
536
"Should be called after :meth:`close` to wait until the underlying "
514
537
"connection is closed, ensuring that all data has been flushed before e.g."
515
538
" exiting the program."
516
- msgstr "하부 연결이 닫힐 때까지 기다리려면 :meth:`close` 뒤에 호출해야 합니다."
539
+ msgstr ""
540
+ "가령 프로그램 종료 전에 모든 데이터가 플러시되었음을 확인하기위해, 하부 연결이 닫힐 때까지 기다리려면 :meth:`close` "
541
+ "뒤에 호출해야 합니다."
517
542
518
543
#: ../../library/asyncio-stream.rst:421
519
544
msgid "Examples"
@@ -577,6 +602,35 @@ msgid ""
577
602
"\n"
578
603
"asyncio.run(main())"
579
604
msgstr ""
605
+ "import asyncio\n"
606
+ "\n"
607
+ "async def handle_echo(reader, writer):\n"
608
+ " data = await reader.read(100)\n"
609
+ " message = data.decode()\n"
610
+ " addr = writer.get_extra_info('peername')\n"
611
+ "\n"
612
+ " print(f\" Received {message!r} from {addr!r}\" )\n"
613
+ "\n"
614
+ " print(f\" Send: {message!r}\" )\n"
615
+ " writer.write(data)\n"
616
+ " await writer.drain()\n"
617
+ "\n"
618
+ " print(\" Close the connection\" )\n"
619
+ " writer.close()\n"
620
+ " await writer.wait_closed()\n"
621
+ "\n"
622
+ "async def main():\n"
623
+ " server = await asyncio.start_server(\n"
624
+ " handle_echo, '127.0.0.1', 8888)\n"
625
+ "\n"
626
+ " addrs = ', '.join(str(sock.getsockname()) for sock in server.sockets)"
627
+ "\n"
628
+ " print(f'Serving on {addrs}')\n"
629
+ "\n"
630
+ " async with server:\n"
631
+ " await server.serve_forever()\n"
632
+ "\n"
633
+ "asyncio.run(main())"
580
634
581
635
#: ../../library/asyncio-stream.rst:495
582
636
msgid ""
@@ -636,22 +690,57 @@ msgid ""
636
690
"url = sys.argv[1]\n"
637
691
"asyncio.run(print_http_headers(url))"
638
692
msgstr ""
693
+ "import asyncio\n"
694
+ "import urllib.parse\n"
695
+ "import sys\n"
696
+ "\n"
697
+ "async def print_http_headers(url):\n"
698
+ " url = urllib.parse.urlsplit(url)\n"
699
+ " if url.scheme == 'https':\n"
700
+ " reader, writer = await asyncio.open_connection(\n"
701
+ " url.hostname, 443, ssl=True)\n"
702
+ " else:\n"
703
+ " reader, writer = await asyncio.open_connection(\n"
704
+ " url.hostname, 80)\n"
705
+ "\n"
706
+ " query = (\n"
707
+ " f\" HEAD {url.path or '/'} HTTP/1.0\\ r\\ n\" \n"
708
+ " f\" Host: {url.hostname}\\ r\\ n\" \n"
709
+ " f\"\\ r\\ n\" \n"
710
+ " )\n"
711
+ "\n"
712
+ " writer.write(query.encode('latin-1'))\n"
713
+ " while True:\n"
714
+ " line = await reader.readline()\n"
715
+ " if not line:\n"
716
+ " break\n"
717
+ "\n"
718
+ " line = line.decode('latin1').rstrip()\n"
719
+ " if line:\n"
720
+ " print(f'HTTP header> {line}')\n"
721
+ "\n"
722
+ " # 바디를 무시하고, 소켓을 닫습니다\n"
723
+ " writer.close()\n"
724
+ " await writer.wait_closed()\n"
725
+ "\n"
726
+ "url = sys.argv[1]\n"
727
+ "asyncio.run(print_http_headers(url))"
639
728
640
729
#: ../../library/asyncio-stream.rst:541
641
730
msgid "Usage::"
642
731
msgstr "사용법::"
643
732
644
733
#: ../../library/asyncio-stream.rst:543
645
734
msgid "python example.py http://example.com/path/page.html"
646
- msgstr ""
735
+ msgstr "python example.py http://example.com/path/page.html "
647
736
648
737
#: ../../library/asyncio-stream.rst:545
649
738
msgid "or with HTTPS::"
650
739
msgstr "또는 HTTPS를 사용하면::"
651
740
652
741
#: ../../library/asyncio-stream.rst:547
653
742
msgid "python example.py https://example.com/path/page.html"
654
- msgstr ""
743
+ msgstr "python example.py https://example.com/path/page.html "
655
744
656
745
#: ../../library/asyncio-stream.rst:553
657
746
msgid "Register an open socket to wait for data using streams"
@@ -695,6 +784,34 @@ msgid ""
695
784
"\n"
696
785
"asyncio.run(wait_for_data())"
697
786
msgstr ""
787
+ "import asyncio\n"
788
+ "import socket\n"
789
+ "\n"
790
+ "async def wait_for_data():\n"
791
+ " # 저수준 API에 액세스하기 위해 현재 이벤트 루프에 대한 참조를 가져옵니다.\n"
792
+ " loop = asyncio.get_running_loop()\n"
793
+ "\n"
794
+ " # 연결된 소켓 쌍을 만듭니다.\n"
795
+ " rsock, wsock = socket.socketpair()\n"
796
+ "\n"
797
+ " # 데이터를 기다리는 열린 소켓을 등록합니다.\n"
798
+ " reader, writer = await asyncio.open_connection(sock=rsock)\n"
799
+ "\n"
800
+ " # 네트워크로부터의 데이터 수신을 시뮬레이션합니다\n"
801
+ " loop.call_soon(wsock.send, 'abc'.encode())\n"
802
+ "\n"
803
+ " # 데이터를 기다립니다\n"
804
+ " data = await reader.read(100)\n"
805
+ "\n"
806
+ " # 데이터를 받았습니다, 할 일을 마쳤습니다: 소켓을 닫습니다.\n"
807
+ " print(\" Received:\" , data.decode())\n"
808
+ " writer.close()\n"
809
+ " await writer.wait_closed()\n"
810
+ "\n"
811
+ " # 두 번째 소켓을 닫습니다\n"
812
+ " wsock.close()\n"
813
+ "\n"
814
+ "asyncio.run(wait_for_data())"
698
815
699
816
#: ../../library/asyncio-stream.rst:590
700
817
msgid ""
0 commit comments