@@ -59,6 +59,24 @@ msgid ""
5959"\n"
6060"asyncio.run(tcp_echo_client('Hello World!'))"
6161msgstr ""
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!'))"
6280
6381#: ../../library/asyncio-stream.rst:42
6482msgid "See also the `Examples`_ section below."
@@ -110,9 +128,8 @@ msgid ""
110128msgstr ""
111129
112130#: ../../library/asyncio-stream.rst:78
113- #, fuzzy
114131msgid "Added the *ssl_handshake_timeout* parameter."
115- msgstr "*ssl_handshake_timeout* 매개 변수 ."
132+ msgstr "*ssl_handshake_timeout* 매개 변수를 추가했습니다 ."
116133
117134#: ../../library/asyncio-stream.rst:81
118135msgid "Added the *happy_eyeballs_delay* and *interleave* parameters."
@@ -126,9 +143,8 @@ msgstr ""
126143#: ../../library/asyncio-stream.rst:87 ../../library/asyncio-stream.rst:131
127144#: ../../library/asyncio-stream.rst:167 ../../library/asyncio-stream.rst:198
128145#: ../../library/asyncio-stream.rst:397
129- #, fuzzy
130146msgid "Added the *ssl_shutdown_timeout* parameter."
131- msgstr "*ssl_handshake_timeout * 매개 변수 ."
147+ msgstr "*ssl_shutdown_timeout * 매개 변수를 추가했습니다 ."
132148
133149#: ../../library/asyncio-stream.rst:101
134150msgid "Start a socket server."
@@ -168,14 +184,12 @@ msgid ""
168184msgstr ""
169185
170186#: ../../library/asyncio-stream.rst:125
171- #, fuzzy
172187msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters."
173- msgstr "*ssl_handshake_timeout* 와 *start_serving* 매개 변수 ."
188+ msgstr "*ssl_handshake_timeout* 와 *start_serving* 매개 변수를 추가했습니다 ."
174189
175190#: ../../library/asyncio-stream.rst:134
176- #, fuzzy
177191msgid "Added the *keep_alive* parameter."
178- msgstr "*ssl_handshake_timeout * 매개 변수 ."
192+ msgstr "*keep_alive * 매개 변수를 추가했습니다 ."
179193
180194#: ../../library/asyncio-stream.rst:139
181195msgid "Unix Sockets"
@@ -200,11 +214,12 @@ msgid "Availability"
200214msgstr "가용성"
201215
202216#: ../../library/asyncio-stream.rst:160
203- #, fuzzy
204217msgid ""
205218"Added the *ssl_handshake_timeout* parameter. The *path* parameter can now"
206219" 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>`\\ 가 될 수 있습니다."
208223
209224#: ../../library/asyncio-stream.rst:177
210225msgid "Start a Unix socket server."
@@ -219,23 +234,25 @@ msgid "See also the documentation of :meth:`loop.create_unix_server`."
219234msgstr ":meth:`loop.create_unix_server`\\ 의 설명서도 참조하십시오."
220235
221236#: ../../library/asyncio-stream.rst:191
222- #, fuzzy
223237msgid ""
224238"Added the *ssl_handshake_timeout* and *start_serving* parameters. The "
225239"*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>`\\ 가 될 수 있습니다."
227243
228244#: ../../library/asyncio-stream.rst:203
229245msgid "StreamReader"
230246msgstr "StreamReader"
231247
232248#: ../../library/asyncio-stream.rst:207
233- #, fuzzy
234249msgid ""
235250"Represents a reader object that provides APIs to read data from the IO "
236251"stream. As an :term:`asynchronous iterable`, the object supports the "
237252":keyword:`async for` statement."
238- msgstr "IO 스트림에서 데이터를 읽는 API를 제공하는 판독기(reader) 객체를 나타냅니다."
253+ msgstr ""
254+ "IO 스트림에서 데이터를 읽는 API를 제공하는 판독기(reader) 객체를 나타냅니다. :term:`비동기 이터러블 "
255+ "<asynchronous iterable>`\\ 로서, 객체는 :keyword:`async for` 문을 지원합니다."
239256
240257#: ../../library/asyncio-stream.rst:211
241258msgid ""
@@ -254,12 +271,13 @@ msgid "Read up to *n* bytes from the stream."
254271msgstr ""
255272
256273#: ../../library/asyncio-stream.rst:224
257- #, fuzzy
258274msgid ""
259275"If *n* is not provided or set to ``-1``, read until EOF, then return all "
260276"read :class:`bytes`. If EOF was received and the internal buffer is "
261277"empty, return an empty ``bytes`` object."
262- msgstr "EOF를 수신했고 내부 버퍼가 비어 있으면, 빈 ``bytes`` 객체를 반환합니다."
278+ msgstr ""
279+ "*n*\\ 이 제공되지 않거나 ``-1``\\ 로 설정되면, EOF까지 읽은 다음, 모든 읽어들인 :class:`bytes`\\ 를 "
280+ "반환합니다. EOF를 수신했고 내부 버퍼가 비어 있으면, 빈 ``bytes`` 객체를 반환합니다."
263281
264282#: ../../library/asyncio-stream.rst:229
265283msgid "If *n* is ``0``, return an empty ``bytes`` object immediately."
@@ -342,9 +360,8 @@ msgid ""
342360msgstr ""
343361
344362#: ../../library/asyncio-stream.rst:285
345- #, fuzzy
346363msgid "The *separator* parameter may now be a :class:`tuple` of separators."
347- msgstr "*path * 매개 변수는 이제 :term:`경로류 객체 <path-like object> `\\ 가 될 수 있습니다."
364+ msgstr "*separator * 매개 변수는 이제 구분자들의 :class:`tuple `\\ 일 수 있습니다."
348365
349366#: ../../library/asyncio-stream.rst:290
350367msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called."
@@ -386,6 +403,8 @@ msgid ""
386403"stream.write(data)\n"
387404"await stream.drain()"
388405msgstr ""
406+ "stream.write(data)\n"
407+ "await stream.drain()"
389408
390409#: ../../library/asyncio-stream.rst:319
391410msgid ""
@@ -401,23 +420,26 @@ msgid ""
401420"stream.writelines(lines)\n"
402421"await stream.drain()"
403422msgstr ""
423+ "stream.writelines(lines)\n"
424+ "await stream.drain()"
404425
405426#: ../../library/asyncio-stream.rst:331
406427msgid "The method closes the stream and the underlying socket."
407428msgstr "이 메서드는 스트림과 하부 소켓을 닫습니다."
408429
409430#: ../../library/asyncio-stream.rst:333
410- #, fuzzy
411431msgid ""
412432"The method should be used, though not mandatory, along with the "
413433"``wait_closed()`` method::"
414- msgstr "이 메서드는 ``wait_closed()`` 메서드와 함께 사용해야 합니다::"
434+ msgstr "이 메서드는 필수는 아니지만 ``wait_closed()`` 메서드와 함께 사용해야 합니다::"
415435
416436#: ../../library/asyncio-stream.rst:336
417437msgid ""
418438"stream.close()\n"
419439"await stream.wait_closed()"
420440msgstr ""
441+ "stream.close()\n"
442+ "await stream.wait_closed()"
421443
422444#: ../../library/asyncio-stream.rst:341
423445msgid ""
@@ -454,6 +476,8 @@ msgid ""
454476"writer.write(data)\n"
455477"await writer.drain()"
456478msgstr ""
479+ "writer.write(data)\n"
480+ "await writer.drain()"
457481
458482#: ../../library/asyncio-stream.rst:367
459483msgid ""
@@ -508,12 +532,13 @@ msgid "Wait until the stream is closed."
508532msgstr "스트림이 닫힐 때까지 기다립니다."
509533
510534#: ../../library/asyncio-stream.rst:413
511- #, fuzzy
512535msgid ""
513536"Should be called after :meth:`close` to wait until the underlying "
514537"connection is closed, ensuring that all data has been flushed before e.g."
515538" exiting the program."
516- msgstr "하부 연결이 닫힐 때까지 기다리려면 :meth:`close` 뒤에 호출해야 합니다."
539+ msgstr ""
540+ "가령 프로그램 종료 전에 모든 데이터가 플러시되었음을 확인하기위해, 하부 연결이 닫힐 때까지 기다리려면 :meth:`close` "
541+ "뒤에 호출해야 합니다."
517542
518543#: ../../library/asyncio-stream.rst:421
519544msgid "Examples"
@@ -577,6 +602,35 @@ msgid ""
577602"\n"
578603"asyncio.run(main())"
579604msgstr ""
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())"
580634
581635#: ../../library/asyncio-stream.rst:495
582636msgid ""
@@ -636,22 +690,57 @@ msgid ""
636690"url = sys.argv[1]\n"
637691"asyncio.run(print_http_headers(url))"
638692msgstr ""
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))"
639728
640729#: ../../library/asyncio-stream.rst:541
641730msgid "Usage::"
642731msgstr "사용법::"
643732
644733#: ../../library/asyncio-stream.rst:543
645734msgid "python example.py http://example.com/path/page.html"
646- msgstr ""
735+ msgstr "python example.py http://example.com/path/page.html "
647736
648737#: ../../library/asyncio-stream.rst:545
649738msgid "or with HTTPS::"
650739msgstr "또는 HTTPS를 사용하면::"
651740
652741#: ../../library/asyncio-stream.rst:547
653742msgid "python example.py https://example.com/path/page.html"
654- msgstr ""
743+ msgstr "python example.py https://example.com/path/page.html "
655744
656745#: ../../library/asyncio-stream.rst:553
657746msgid "Register an open socket to wait for data using streams"
@@ -695,6 +784,34 @@ msgid ""
695784"\n"
696785"asyncio.run(wait_for_data())"
697786msgstr ""
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())"
698815
699816#: ../../library/asyncio-stream.rst:590
700817msgid ""
0 commit comments