Repository navigation
Expand file tree
/
Copy pathasyncio-protocol.po
More file actions
1155 lines (961 loc) · 73 KB
/
Copy pathasyncio-protocol.po
File metadata and controls
1155 lines (961 loc) · 73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Alireza Shabani (Revisto) <theRevisto@gmail.com>, 2025
# Danial Behzadi <dani.behzi@ubuntu.com>, 2025
# Rafael Fontenelle <rffontenelle@gmail.com>, 2025
# Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-16 12:56+0000\n"
"PO-Revision-Date: 2026-09-14 09:45+0330\n"
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
"Language-Team: Persian (https://github.com/python/python-docs-fa/)\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.6\n"
msgid "Transports and Protocols"
msgstr "انتقالها و پروتکلها"
msgid "Preface"
msgstr "پیشگفتار"
msgid "Transports and Protocols are used by the **low-level** event loop APIs such as :meth:`loop.create_connection`. They use callback-based programming style and enable high-performance implementations of network or IPC protocols (e.g. HTTP)."
msgstr "انتقالها و پروتکلها (Transports and Protocols) توسط APIهای **سطح پایین** حلقه رویداد مانند :meth:`loop.create_connection` استفاده میشوند. آنها از سبک برنامهنویسی مبتنی بر کالبک استفاده میکنند و پیادهسازیهای با کارایی بالای پروتکلهای شبکه یا IPC (مانند HTTP) را ممکن میسازند."
msgid "Essentially, transports and protocols should only be used in libraries and frameworks and never in high-level asyncio applications."
msgstr "در اصل، انتقالهاو پروتکلها تنها باید در کتابخانهها و چارچوبها استفاده شوند و هرگز در برنامههای asyncio سطحبالا استفاده نشوند."
msgid "This documentation page covers both `Transports`_ and `Protocols`_."
msgstr "این صفحهی مستندات، هر دو `Transports`_ و `Protocols`_ را پوشش میدهد."
msgid "Introduction"
msgstr "مقدمه"
msgid "At the highest level, the transport is concerned with *how* bytes are transmitted, while the protocol determines *which* bytes to transmit (and to some extent when)."
msgstr "در بالاترین سطح، انتقال به *چگونگی* ارسال بایتها مربوط است، در حالی که پروتکل تعیین میکند که *کدام* بایتها ارسال شوند (و تا حدی چه زمانی)."
msgid "A different way of saying the same thing: a transport is an abstraction for a socket (or similar I/O endpoint) while a protocol is an abstraction for an application, from the transport's point of view."
msgstr "راه دیگری برای بیان همان مطلب: یک انتقالانتزاعی از یک سوکت (یا پایانه ورودی/خروجی مشابه) است، در حالی که یک پروتکل، از دیدگاه انتقال، انتزاعی از یک برنامه است."
msgid "Yet another view is the transport and protocol interfaces together define an abstract interface for using network I/O and interprocess I/O."
msgstr "دیدگاه دیگر این است که رابطهای انتقال و پروتکل با هم یک رابط انتزاعی برای استفاده از I/O شبکه و I/O بینفرایندی تعریف میکنند."
msgid "There is always a 1:1 relationship between transport and protocol objects: the protocol calls transport methods to send data, while the transport calls protocol methods to pass it data that has been received."
msgstr "همیشه یک رابطهی ۱:۱ بین اشیای انتقالو پروتکل وجود دارد: پروتکل متدهای انتقال را برای ارسال داده فراخوانی میکند، در حالی که انتقال متدهای پروتکل را فراخوانی میکند تا دادههای دریافتشده را به آن منتقل کند."
msgid "Most of connection oriented event loop methods (such as :meth:`loop.create_connection`) usually accept a *protocol_factory* argument used to create a *Protocol* object for an accepted connection, represented by a *Transport* object. Such methods usually return a tuple of ``(transport, protocol)``."
msgstr "بیشتر متدهای اتصالمحور حلقه رویداد (مانند :meth:`loop.create_connection`) معمولاً آرگومان *protocol_factory* را میپذیرند که برای ایجاد یک شیء *Protocol* برای یک اتصال پذیرفتهشده که با یک شیء *Transport* نمایش داده میشود، استفاده میشود. چنین متدهایی معمولاً یک تاپل ``(transport, protocol)`` را برمیگردانند."
msgid "Contents"
msgstr "فهرست"
msgid "This documentation page contains the following sections:"
msgstr "این صفحهی مستندات شامل بخشهای زیر است:"
msgid "The `Transports`_ section documents asyncio :class:`BaseTransport`, :class:`ReadTransport`, :class:`WriteTransport`, :class:`Transport`, :class:`DatagramTransport`, and :class:`SubprocessTransport` classes."
msgstr "بخش `Transports`_ کلاسهای asyncio شامل :class:`BaseTransport`، :class:`ReadTransport`، :class:`WriteTransport`، :class:`Transport`، :class:`DatagramTransport` و :class:`SubprocessTransport` را مستند میکند."
msgid "The `Protocols`_ section documents asyncio :class:`BaseProtocol`, :class:`Protocol`, :class:`BufferedProtocol`, :class:`DatagramProtocol`, and :class:`SubprocessProtocol` classes."
msgstr "بخش `Protocols`_ کلاسهای asyncio :class:`BaseProtocol`، :class:`Protocol`، :class:`BufferedProtocol`، :class:`DatagramProtocol` و :class:`SubprocessProtocol` را مستند میکند."
msgid "The `Examples`_ section showcases how to work with transports, protocols, and low-level event loop APIs."
msgstr "بخش `Examples`_ چگونگی کار با ترابریها، پروتکلها (protocols) و APIهای سطح پایین حلقه رویداد را نمایش میدهد."
msgid "Transports"
msgstr "انتقالها"
msgid "**Source code:** :source:`Lib/asyncio/transports.py`"
msgstr "**کد منبع:** :source:`Lib/asyncio/transports.py`"
msgid "Transports are classes provided by :mod:`asyncio` in order to abstract various kinds of communication channels."
msgstr "ترابرهاکلاسهایی هستند که توسط :mod:`asyncio` فراهم شدهاند تا انواع مختلفی از کانالهای ارتباطی را انتزاع کنند."
msgid "Transport objects are always instantiated by an :ref:`asyncio event loop <asyncio-event-loop>`."
msgstr "اشیای Transport همیشه توسط یک :ref:`حلقه رویداد asyncio <asyncio-event-loop>` نمونهسازی میشوند."
msgid "asyncio implements transports for TCP, UDP, SSL, and subprocess pipes. The methods available on a transport depend on the transport's kind."
msgstr "asyncio انتقالهارا برای TCP، UDP، SSL و پایپهای subprocess پیادهسازی میکند. متدهای در دسترس برای یک انتقال، به نوع آن انتقال بستگی دارند."
msgid "The transport classes are :ref:`not thread safe <asyncio-multithreading>`."
msgstr "کلاسهای انتقال :ref:`نخایمن نیستند <asyncio-multithreading>`."
msgid "Transports Hierarchy"
msgstr "سلسلهمراتب ترابریها"
msgid "Base class for all transports. Contains methods that all asyncio transports share."
msgstr "کلاس پایه برای همهی انتقالها . شامل متدهایی است که همهی انتقالها در asyncio آنها را به اشتراک میگذارند."
msgid "A base transport for write-only connections."
msgstr "یک ترابری پایه برای اتصالهای فقطنوشتنی."
msgid "Instances of the *WriteTransport* class are returned from the :meth:`loop.connect_write_pipe` event loop method and are also used by subprocess-related methods like :meth:`loop.subprocess_exec`."
msgstr "نمونههای کلاس *WriteTransport* از متد حلقه رویداد :meth:`loop.connect_write_pipe` برگردانده میشوند و همچنین توسط متدهای مرتبط با زیرفرایند (subprocess) مانند :meth:`loop.subprocess_exec` استفاده میشوند."
msgid "A base transport for read-only connections."
msgstr "یک انتقالپایه برای اتصالهای فقطخواندنی."
msgid "Instances of the *ReadTransport* class are returned from the :meth:`loop.connect_read_pipe` event loop method and are also used by subprocess-related methods like :meth:`loop.subprocess_exec`."
msgstr "نمونههای کلاس *ReadTransport* از متد حلقه رویداد :meth:`loop.connect_read_pipe` بازگردانده میشوند و متدهای مرتبط با زیرفرایند مانند :meth:`loop.subprocess_exec` نیز از آنها استفاده میکنند."
msgid "Interface representing a bidirectional transport, such as a TCP connection."
msgstr "رابطی که یک انتقال دوطرفه، مانند اتصال TCP، را نشان میدهد."
msgid "The user does not instantiate a transport directly; they call a utility function, passing it a protocol factory and other information necessary to create the transport and protocol."
msgstr "کاربر یک انتقالرا مستقیماً نمونهسازی نمیکند؛ بلکه یک تابع کمکی را فراخوانی میکند و یک کارخانهی پروتکل و سایر اطلاعات لازم برای ایجاد انتقالو پروتکل را به آن میدهد."
msgid "Instances of the *Transport* class are returned from or used by event loop methods like :meth:`loop.create_connection`, :meth:`loop.create_unix_connection`, :meth:`loop.create_server`, :meth:`loop.sendfile`, etc."
msgstr "نمونههای کلاس *Transport* توسط متدهای حلقه رویداد مانند :meth:`loop.create_connection`، :meth:`loop.create_unix_connection`، :meth:`loop.create_server`، :meth:`loop.sendfile` و غیره برگردانده یا استفاده میشوند."
msgid "A transport for datagram (UDP) connections."
msgstr "یک انتقالبرای اتصالهای دیتاگرام (UDP)."
msgid "Instances of the *DatagramTransport* class are returned from the :meth:`loop.create_datagram_endpoint` event loop method."
msgstr "نمونههای کلاس *DatagramTransport* از متد حلقه رویداد :meth:`loop.create_datagram_endpoint` برگردانده میشوند."
msgid "An abstraction to represent a connection between a parent and its child OS process."
msgstr "انتزاعی برای نمایش اتصال میان یک فرایند والد و فرایند فرزند سیستمعامل آن."
msgid "Instances of the *SubprocessTransport* class are returned from event loop methods :meth:`loop.subprocess_shell` and :meth:`loop.subprocess_exec`."
msgstr "نمونههای کلاس *SubprocessTransport* از متدهای حلقه رویداد :meth:`loop.subprocess_shell` و :meth:`loop.subprocess_exec` برگردانده میشوند."
msgid "Base Transport"
msgstr "انتقال پایه"
msgid "Close the transport."
msgstr "انتقالرا ببندید."
msgid "If the transport has a buffer for outgoing data, buffered data will be flushed asynchronously. No more data will be received. After all buffered data is flushed, the protocol's :meth:`protocol.connection_lost() <BaseProtocol.connection_lost>` method will be called with :const:`None` as its argument. The transport should not be used once it is closed."
msgstr "اگر انتقالبرای دادههای خروجی دارای بافرباشد، دادههای بافرشده بهصورت ناهمگام تخلیه خواهند شد. دیگر دادهای دریافت نخواهد شد. پس از تخلیهی همهی دادههای بافرشده، متد :meth:`protocol.connection_lost() <BaseProtocol.connection_lost>` پروتکل با :const:`None` بهعنوان آرگومان آن فراخوانی خواهد شد. پس از بسته شدن، نباید از انتقال استفاده شود."
msgid "Return ``True`` if the transport is closing or is closed."
msgstr "اگر انتقالدر حال بسته شدن یا بسته باشد، ``True`` را برمیگرداند."
msgid "Return information about the transport or underlying resources it uses."
msgstr "اطلاعات دربارهی انتقالیا منابع زیربنایی مورد استفادهی آن را برمیگرداند."
msgid "*name* is a string representing the piece of transport-specific information to get."
msgstr "*name* رشتهای است که نشاندهندهی بخشی از اطلاعات ویژهی انتقال (transport-specific) است که باید دریافت شود."
msgid "*default* is the value to return if the information is not available, or if the transport does not support querying it with the given third-party event loop implementation or on the current platform."
msgstr "*default* مقداری است که باید در صورت در دسترس نبودن اطلاعات، یا اگر انتقال از پرسوجوی آن با پیادهسازی حلقه رویداد شخص ثالثِ دادهشده یا در پلتفرم فعلی پشتیبانی نکند، برگردانده شود."
msgid "For example, the following code attempts to get the underlying socket object of the transport::"
msgstr "برای مثال، کد زیر تلاش میکند شیء سوکت زیربناییِ انتقالرا دریافت کند::"
msgid ""
"sock = transport.get_extra_info('socket')\n"
"if sock is not None:\n"
" print(sock.getsockopt(...))"
msgstr ""
"sock = transport.get_extra_info('socket')\n"
"if sock is not None:\n"
" print(sock.getsockopt(...))"
msgid "Categories of information that can be queried on some transports:"
msgstr "دستههای اطلاعاتی که میتوان آنها را در برخی از انتقالها پرسوجو کرد:"
msgid "socket:"
msgstr "سوکت:"
msgid "``'peername'``: the remote address to which the socket is connected, result of :meth:`socket.socket.getpeername` (``None`` on error)"
msgstr "``'peername'``: نشانی دوردستی که سوکت به آن متصل است، نتیجه :meth:`socket.socket.getpeername` (``None`` در صورت خطا)"
msgid "``'socket'``: :class:`socket.socket` instance"
msgstr "``'socket'``: نمونهی :class:`socket.socket`"
msgid "``'sockname'``: the socket's own address, result of :meth:`socket.socket.getsockname`"
msgstr "``'sockname'``: نشانی خود سوکت، نتیجهی :meth:`socket.socket.getsockname`"
msgid "SSL socket:"
msgstr "سوکت SSL:"
msgid "``'compression'``: the compression algorithm being used as a string, or ``None`` if the connection isn't compressed; result of :meth:`ssl.SSLSocket.compression`"
msgstr "``'compression'``: الگوریتم فشردهسازی استفادهشده بهصورت یک رشته، یا ``None`` اگر اتصال فشردهنشده باشد؛ نتیجهی :meth:`ssl.SSLSocket.compression`"
msgid "``'cipher'``: a three-value tuple containing the name of the cipher being used, the version of the SSL protocol that defines its use, and the number of secret bits being used; result of :meth:`ssl.SSLSocket.cipher`"
msgstr "``'cipher'``: یک تاپل سهمقداری شامل نام رمز استفادهشده، نسخهی پروتکل SSL که استفادهی آن را تعریف میکند، و تعداد بیتهای محرمانهی استفادهشده؛ نتیجهی :meth:`ssl.SSLSocket.cipher`"
msgid "``'peercert'``: peer certificate; result of :meth:`ssl.SSLSocket.getpeercert`"
msgstr "``'peercert'``: گواهی همتا؛ نتیجهی :meth:`ssl.SSLSocket.getpeercert`"
msgid "``'sslcontext'``: :class:`ssl.SSLContext` instance"
msgstr "``'sslcontext'``: نمونهی :class:`ssl.SSLContext`"
msgid "``'ssl_object'``: :class:`ssl.SSLObject` or :class:`ssl.SSLSocket` instance"
msgstr "``'ssl_object'``: نمونهای از :class:`ssl.SSLObject` یا :class:`ssl.SSLSocket`"
msgid "pipe:"
msgstr "پایپ :"
msgid "``'pipe'``: pipe object"
msgstr "``'pipe'``: شیء پایپ"
msgid "subprocess:"
msgstr "subprocess:"
msgid "``'subprocess'``: :class:`subprocess.Popen` instance"
msgstr "``'subprocess'``: نمونهای از :class:`subprocess.Popen`"
msgid "Set a new protocol."
msgstr "تنظیم یک پروتکل جدید."
msgid "Switching protocol should only be done when both protocols are documented to support the switch."
msgstr "تعویض پروتکل تنها باید زمانی انجام شود که در مستندات آمده باشد که هر دو پروتکل از این تعویض پشتیبانی میکنند."
msgid "Return the current protocol."
msgstr "پروتکل جاری را برمیگرداند."
msgid "Read-only Transports"
msgstr "انتقالهای فقطخواندنی"
msgid "Return ``True`` if the transport is receiving new data."
msgstr "اگر انتقالدر حال دریافت دادههای جدید باشد، ``True`` را برمیگرداند."
msgid "Pause the receiving end of the transport. No data will be passed to the protocol's :meth:`protocol.data_received() <Protocol.data_received>` method until :meth:`resume_reading` is called."
msgstr "سمت دریافتی انتقالرا متوقف کنید. تا زمانی که :meth:`resume_reading` فراخوانی نشود، هیچ دادهای به متد :meth:`protocol.data_received() <Protocol.data_received>` پروتکل منتقل نخواهد شد."
msgid "The method is idempotent, i.e. it can be called when the transport is already paused or closed."
msgstr "این متد همتوان است؛ یعنی میتوان آن را هنگامی فراخوانی کرد که انتقال از قبل متوقف یا بسته شده باشد."
msgid "Resume the receiving end. The protocol's :meth:`protocol.data_received() <Protocol.data_received>` method will be called once again if some data is available for reading."
msgstr "سمت دریافت را از سر میگیرد. اگر دادهای برای خواندن در دسترس باشد، متد :meth:`protocol.data_received() <Protocol.data_received>` پروتکل بار دیگر فراخوانی خواهد شد."
msgid "The method is idempotent, i.e. it can be called when the transport is already reading."
msgstr "این متد همتوان (idempotent) است، یعنی میتوان آن را زمانی که انتقال از قبل در حال خواندن است فراخوانی کرد."
msgid "Write-only Transports"
msgstr "انتقالهای فقط نوشتنی"
msgid "Close the transport immediately, without waiting for pending operations to complete. Buffered data will be lost. No more data will be received. The protocol's :meth:`protocol.connection_lost() <BaseProtocol.connection_lost>` method will eventually be called with :const:`None` as its argument."
msgstr "انتقالرا بلافاصله، بدون انتظار برای تکمیل عملیاتهای در انتظار، ببندید. دادههای بافرشده از بین خواهند رفت. دیگر دادهای دریافت نخواهد شد. متد :meth:`protocol.connection_lost() <BaseProtocol.connection_lost>` پروتکل در نهایت با :const:`None` بهعنوان آرگومان آن فراخوانی خواهد شد."
msgid "Return :const:`True` if the transport supports :meth:`~WriteTransport.write_eof`, :const:`False` if not."
msgstr "اگر انتقالاز :meth:`~WriteTransport.write_eof` پشتیبانی کند، :const:`True` و در غیر این صورت :const:`False` برمیگرداند."
msgid "Return the current size of the output buffer used by the transport."
msgstr "اندازهی فعلی بافر خروجی استفادهشده توسط انتقالدهندهرا برمیگرداند."
msgid "Get the *high* and *low* watermarks for write flow control. Return a tuple ``(low, high)`` where *low* and *high* are positive number of bytes."
msgstr "واترمارکهای *high* و *low* را برای کنترل جریان نوشتن دریافت میکند. یک تاپل ``(low, high)`` برمیگرداند که در آن *low* و *high* اعداد مثبتی از بایتها هستند."
msgid "Use :meth:`set_write_buffer_limits` to set the limits."
msgstr "برای تنظیم محدودیتها از :meth:`set_write_buffer_limits` استفاده کنید."
msgid "Set the *high* and *low* watermarks for write flow control."
msgstr "آستانههای *high* و *low* (watermarks) برای کنترل جریان نوشتن را تنظیم کنید."
msgid "These two values (measured in number of bytes) control when the protocol's :meth:`protocol.pause_writing() <BaseProtocol.pause_writing>` and :meth:`protocol.resume_writing() <BaseProtocol.resume_writing>` methods are called. If specified, the low watermark must be less than or equal to the high watermark. Neither *high* nor *low* can be negative."
msgstr "این دو مقدار (که بر حسب تعداد بایتها اندازهگیری میشوند) کنترل میکنند که متدهای پروتکل، یعنی :meth:`protocol.pause_writing() <BaseProtocol.pause_writing>` و :meth:`protocol.resume_writing() <BaseProtocol.resume_writing>`، چه زمانی فراخوانی میشوند. در صورت مشخص شدن، آستانه پایین (low watermark) باید کوچکتر یا مساوی آستانه بالا (high watermark) باشد. هیچکدام از *high* و *low* نمیتوانند منفی باشند."
msgid ":meth:`~BaseProtocol.pause_writing` is called when the buffer size becomes greater than or equal to the *high* value. If writing has been paused, :meth:`~BaseProtocol.resume_writing` is called when the buffer size becomes less than or equal to the *low* value."
msgstr ":meth:`~BaseProtocol.pause_writing` زمانی فراخوانی میشود که اندازهی بافر بزرگتر یا مساوی مقدار *high* شود. اگر نوشتن متوقف شده باشد، :meth:`~BaseProtocol.resume_writing` زمانی فراخوانی میشود که اندازهی بافر کوچکتر یا مساوی مقدار *low* شود."
msgid "The defaults are implementation-specific. If only the high watermark is given, the low watermark defaults to an implementation-specific value less than or equal to the high watermark. Setting *high* to zero forces *low* to zero as well, and causes :meth:`~BaseProtocol.pause_writing` to be called whenever the buffer becomes non-empty. Setting *low* to zero causes :meth:`~BaseProtocol.resume_writing` to be called only once the buffer is empty. Use of zero for either limit is generally sub-optimal as it reduces opportunities for doing I/O and computation concurrently."
msgstr "مقادیر پیشفرض وابسته به پیادهسازی هستند. اگر فقط آستانهی بالا (high watermark) داده شود، مقدار پیشفرض آستانهی پایین (low watermark) مقداری وابسته به پیادهسازی و کوچکتر یا مساوی آستانهی بالا خواهد بود. تنظیم *high* روی صفر، *low* را نیز روی صفر قرار میدهد و باعث میشود :meth:`~BaseProtocol.pause_writing` هر زمان که بافر غیرخالی شود، فراخوانی شود. تنظیم *low* روی صفر باعث میشود :meth:`~BaseProtocol.resume_writing` فقط زمانی فراخوانی شود که بافر خالی شود. استفاده از صفر برای هر یک از این دو محدودیت معمولاً بهینه نیست، زیرا فرصتهای انجام I/O و محاسبات بهصورت همزمان را کاهش میدهد."
msgid "Use :meth:`~WriteTransport.get_write_buffer_limits` to get the limits."
msgstr "برای دریافت محدودیتها از :meth:`~WriteTransport.get_write_buffer_limits` استفاده کنید."
msgid "Write some *data* bytes to the transport."
msgstr "تعدادی بایت *data* را به انتقالبنویسید."
msgid "This method does not block; it buffers the data and arranges for it to be sent out asynchronously."
msgstr "این متد باعث مسدودشدن نمیشود؛ دادهها را بافر میکند و ترتیبی میدهد که بهصورت ناهمگام ارسال شوند."
msgid "Write a list (or any iterable) of data bytes to the transport. This is functionally equivalent to calling :meth:`write` on each element yielded by the iterable, but may be implemented more efficiently."
msgstr "یک فهرست (یا هر پیمایشپذیری) از بایتهای داده را به انتقالدهنده بنویسید. این کار از نظر عملکردی معادل فراخوانی :meth:`write` روی هر عنصری است که پیمایشپذیر تولید میکند، اما ممکن است بهشکل کارآمدتری پیادهسازی شده باشد."
msgid "Close the write end of the transport after flushing all buffered data. Data may still be received."
msgstr "پس از تخلیهی تمام دادههای بافرشده، سمت نوشتاری انتقالرا ببندید. ممکن است هنوز دادههایی دریافت شوند."
msgid "This method can raise :exc:`NotImplementedError` if the transport (e.g. SSL) doesn't support half-closed connections."
msgstr "این متد ممکن است در صورتی که انتقال (transport، برای مثال SSL) از اتصالات نیمهبسته پشتیبانی نکند، :exc:`NotImplementedError` را پرتاب کند."
msgid "Datagram Transports"
msgstr "انتقالهای دیتاگرام (Datagram Transports)"
msgid "Send the *data* bytes to the remote peer given by *addr* (a transport-dependent target address). If *addr* is :const:`None`, the data is sent to the target address given on transport creation."
msgstr "بایتهای *data* را به همتای راه دور مشخصشده توسط *addr* (یک آدرس مقصد وابسته به انتقال) ارسال کنید. اگر *addr* برابر :const:`None` باشد، دادهها به آدرس مقصد مشخصشده در هنگام ایجاد انتقال ارسال میشوند."
msgid "This method can be called with an empty bytes object to send a zero-length datagram. The buffer size calculation used for flow control is also updated to account for the datagram header."
msgstr "این متد را میتوان با یک شیء bytes خالی فراخوانی کرد تا یک دیتاگرام (datagram) با طول صفر ارسال شود. محاسبهی اندازهی بافرکه برای کنترل جریان استفاده میشود نیز بهروزرسانی میشود تا سرآیند دیتاگرام را در نظر بگیرد."
msgid "Close the transport immediately, without waiting for pending operations to complete. Buffered data will be lost. No more data will be received. The protocol's :meth:`protocol.connection_lost() <BaseProtocol.connection_lost>` method will eventually be called with :const:`None` as its argument."
msgstr "انتقالرا بلافاصله ببندید، بدون انتظار برای تکمیل عملیاتهای در انتظار. دادههای بافرشده از دست خواهند رفت. دیگر دادهای دریافت نخواهد شد. متد :meth:`protocol.connection_lost() <BaseProtocol.connection_lost>` پروتکل در نهایت با :const:`None` بهعنوان آرگومان آن فراخوانی خواهد شد."
msgid "Subprocess Transports"
msgstr "انتقالهای زیرفرایند"
msgid "Return the subprocess process id as an integer."
msgstr "شناسه فرایند زیرفرایند را بهصورت یک عدد صحیح برمیگرداند."
msgid "Return the transport for the communication pipe corresponding to the integer file descriptor *fd*:"
msgstr "انتقال برای پایپ ارتباطی متناظر با توصیفگر پرونده عدد صحیح *fd* را برمیگرداند:"
msgid "``0``: writable streaming transport of the standard input (*stdin*), or :const:`None` if the subprocess was not created with ``stdin=PIPE``"
msgstr "``0``: انتقال جریانی قابل نوشتنبرای ورودی استاندارد (*stdin*)، یا :const:`None` اگر زیرفرایند با ``stdin=PIPE`` ایجاد نشده باشد"
msgid "``1``: readable streaming transport of the standard output (*stdout*), or :const:`None` if the subprocess was not created with ``stdout=PIPE``"
msgstr "``1``: ترابری جریانی قابلخواندن برای خروجی استاندارد (*stdout*)، یا :const:`None` اگر زیرفرآیند با ``stdout=PIPE`` ایجاد نشده باشد"
msgid "``2``: readable streaming transport of the standard error (*stderr*), or :const:`None` if the subprocess was not created with ``stderr=PIPE``"
msgstr "``2``: انتقال جریانی قابل خواندن برای خطای استاندارد (*stderr*)، یا :const:`None` اگر زیرفرآیند با ``stderr=PIPE`` ایجاد نشده باشد"
msgid "other *fd*: :const:`None`"
msgstr "*fd* دیگر: :const:`None`"
msgid "Return the subprocess return code as an integer or :const:`None` if it hasn't returned, which is similar to the :attr:`subprocess.Popen.returncode` attribute."
msgstr "کد بازگشت زیرفرایند را بهصورت یک عدد صحیح، یا در صورتی که هنوز به پایان نرسیده باشد بهصورت :const:`None` برمیگرداند، که مشابه ویژگی :attr:`subprocess.Popen.returncode` است."
msgid "Kill the subprocess."
msgstr "زیرفرایند را خاتمه دهید."
msgid "On POSIX systems, the function sends SIGKILL to the subprocess. On Windows, this method is an alias for :meth:`terminate`."
msgstr "در سیستمهای POSIX، این تابع SIGKILL را به زیرفرایند ارسال میکند. در ویندوز، این متد نام مستعاری برای :meth:`terminate` است."
msgid "See also :meth:`subprocess.Popen.kill`."
msgstr "همچنین :meth:`subprocess.Popen.kill` را ببینید."
msgid "Send the *signal* number to the subprocess, as in :meth:`subprocess.Popen.send_signal`."
msgstr "شمارهی *signal* را به زیرفرایند ارسال کنید، همانطور که در :meth:`subprocess.Popen.send_signal` انجام میشود."
msgid "Stop the subprocess."
msgstr "زیرفرایند را متوقف کنید."
msgid "On POSIX systems, this method sends :py:const:`~signal.SIGTERM` to the subprocess. On Windows, the Windows API function :c:func:`!TerminateProcess` is called to stop the subprocess."
msgstr "در سیستمهای POSIX، این متد :py:const:`~signal.SIGTERM` را به زیرفرایند ارسال میکند. در ویندوز، تابع API ویندوز :c:func:`!TerminateProcess` برای متوقف کردن زیرفرایند فراخوانی میشود."
msgid "See also :meth:`subprocess.Popen.terminate`."
msgstr "همچنین :meth:`subprocess.Popen.terminate` را ببینید."
msgid "Kill the subprocess by calling the :meth:`kill` method."
msgstr "زیرفرایند را با فراخوانی متد :meth:`kill` خاتمه دهید."
msgid "If the subprocess hasn't returned yet, and close transports of *stdin*, *stdout*, and *stderr* pipes."
msgstr "اگر زیرفرایند هنوز بازگشت نکرده است، و انتقالهای پایپهای *stdin*، *stdout* و *stderr* را ببندید."
msgid "Protocols"
msgstr "پروتکلها"
msgid "**Source code:** :source:`Lib/asyncio/protocols.py`"
msgstr "**کد منبع:** :source:`Lib/asyncio/protocols.py`"
msgid "asyncio provides a set of abstract base classes that should be used to implement network protocols. Those classes are meant to be used together with :ref:`transports <asyncio-transport>`."
msgstr "asyncio مجموعهای از کلاسهای پایه انتزاعی را فراهم میکند که باید برای پیادهسازی پروتکلهای شبکه از آنها استفاده شود. این کلاسها برای استفاده همراه با :ref:`transports <asyncio-transport>` در نظر گرفته شدهاند."
msgid "Subclasses of abstract base protocol classes may implement some or all methods. All these methods are callbacks: they are called by transports on certain events, for example when some data is received. A base protocol method should be called by the corresponding transport."
msgstr "زیرکلاسهای کلاسهای پایهی انتزاعی پروتکل ممکن است برخی یا همهی متدها را پیادهسازی کنند. همهی این متدها کالبک هستند: آنها توسط انتقالدهندهها در رویدادهای خاصی فراخوانی میشوند، برای مثال هنگامی که دادههایی دریافت میشود. یک متد از پروتکل پایه باید توسط انتقالدهندهی متناظر فراخوانی شود."
msgid "Base Protocols"
msgstr "پروتکلهای پایه"
msgid "Base protocol with methods that all protocols share."
msgstr "پروتکل پایه با متدهایی که تمام پروتکلها به اشتراک میگذارند."
msgid "The base class for implementing streaming protocols (TCP, Unix sockets, etc)."
msgstr "کلاس پایه برای پیادهسازی پروتکلهای جریانی (TCP، سوکتهای Unix و غیره)."
msgid "A base class for implementing streaming protocols with manual control of the receive buffer."
msgstr "یک کلاس پایه برای پیادهسازی پروتکلهای جریانی (streaming protocols) با کنترل دستی بر بافر دریافت."
msgid "The base class for implementing datagram (UDP) protocols."
msgstr "کلاس پایه برای پیادهسازی پروتکلهای دیتاگرام (UDP)."
msgid "The base class for implementing protocols communicating with child processes (unidirectional pipes)."
msgstr "کلاس پایه برای پیادهسازی پروتکلهای ارتباط با فرایندهای فرزند (پایپهای یکطرفه)."
msgid "Base Protocol"
msgstr "پروتکل پایه"
msgid "All asyncio protocols can implement Base Protocol callbacks."
msgstr "تمام پروتکلهای asyncio میتوانند کالبکهای پروتکل پایه را پیادهسازی کنند."
msgid "Connection Callbacks"
msgstr "کالبکهای اتصال"
msgid "Connection callbacks are called on all protocols, exactly once per a successful connection. All other protocol callbacks can only be called between those two methods."
msgstr "کالبکهای اتصال در تمام پروتکلها، دقیقاً یک بار بهازای هر اتصال موفق فراخوانی میشوند. سایر کالبکهای پروتکل فقط میتوانند بین آن دو متد فراخوانی شوند."
msgid "Called when a connection is made."
msgstr "هنگامی که یک اتصال برقرار میشود، فراخوانی میشود."
msgid "The *transport* argument is the transport representing the connection. The protocol is responsible for storing the reference to its transport."
msgstr "آرگومان *transport*، انتقالی است که نشاندهندهی اتصال است. پروتکل مسئول ذخیرهسازی ارجاع به انتقال خود است."
msgid "Called when the connection is lost or closed."
msgstr "در صورت قطع یا بسته شدن اتصال، فراخوانی میشود."
msgid "The argument is either an exception object or :const:`None`. The latter means a regular EOF is received, or the connection was aborted or closed by this side of the connection."
msgstr "این آرگومان یا یک شیء استثنا است یا :const:`None`. مورد دوم به این معناست که یک EOF معمولی دریافت شده است، یا اتصال از این سمت اتصال قطع یا بسته شده است."
msgid "Flow Control Callbacks"
msgstr "کالبکهای کنترل جریان"
msgid "Flow control callbacks can be called by transports to pause or resume writing performed by the protocol."
msgstr "کالبکهای کنترل جریان میتوانند توسط انتقالهابرای مکث یا از سرگیری نوشتن انجامشده توسط پروتکل فراخوانی شوند."
msgid "See the documentation of the :meth:`~WriteTransport.set_write_buffer_limits` method for more details."
msgstr "برای جزئیات بیشتر، مستندات متد :meth:`~WriteTransport.set_write_buffer_limits` را ببینید."
msgid "Called when the transport's buffer goes over the high watermark."
msgstr "هنگامی که بافر انتقال از آستانهی بالا (high watermark) عبور کند، فراخوانی میشود."
msgid "Called when the transport's buffer drains below the low watermark."
msgstr "هنگامی که بافر انتقالبه کمتر از آستانه پایین (low watermark) تخلیه میشود، فراخوانی میشود."
msgid "If the buffer size equals the high watermark, :meth:`~BaseProtocol.pause_writing` is not called: the buffer size must go strictly over."
msgstr "اگر اندازهی بافر برابر با آستانهی بالا باشد، :meth:`~BaseProtocol.pause_writing` فراخوانی نمیشود: اندازهی بافر باید بهطور اکید از آن عبور کند."
msgid "Conversely, :meth:`~BaseProtocol.resume_writing` is called when the buffer size is equal or lower than the low watermark. These end conditions are important to ensure that things go as expected when either mark is zero."
msgstr "در مقابل، :meth:`~BaseProtocol.resume_writing` زمانی فراخوانی میشود که اندازهی بافر برابر یا کمتر از آستانهی پایین باشد. این شرایط پایان برای اطمینان از اینکه در صفر بودن هر یک از این آستانهها روند کار مطابق انتظار باشد، مهم هستند."
msgid "Streaming Protocols"
msgstr "پروتکلهای جریانی"
msgid "Event methods, such as :meth:`loop.create_server`, :meth:`loop.create_unix_server`, :meth:`loop.create_connection`, :meth:`loop.create_unix_connection`, :meth:`loop.connect_accepted_socket`, :meth:`loop.connect_read_pipe`, and :meth:`loop.connect_write_pipe` accept factories that return streaming protocols."
msgstr "متدهای رویداد، مانند :meth:`loop.create_server`، :meth:`loop.create_unix_server`، :meth:`loop.create_connection`، :meth:`loop.create_unix_connection`، :meth:`loop.connect_accepted_socket`، :meth:`loop.connect_read_pipe` و :meth:`loop.connect_write_pipe`، کارخانههایی را میپذیرند که پروتکلهای جریانی را برمیگردانند."
msgid "Called when some data is received. *data* is a non-empty bytes object containing the incoming data."
msgstr "هنگامی که دادهای دریافت میشود، فراخوانی میشود. *data* یک شیء bytes غیرخالی است که حاوی دادههای ورودی است."
msgid "Whether the data is buffered, chunked or reassembled depends on the transport. In general, you shouldn't rely on specific semantics and instead make your parsing generic and flexible. However, data is always received in the correct order."
msgstr "اینکه دادهها بافر شوند (buffered)، بخشبندی شوند (chunked) یا بازهمسازی شوند (reassembled)، به انتقالبستگی دارد. بهطور کلی، نباید به معناشناسی خاصی تکیه کنید و در عوض تجزیه خود را عام و انعطافپذیر کنید. با این حال، دادهها همیشه به ترتیب صحیح دریافت میشوند."
msgid "The method can be called an arbitrary number of times while a connection is open."
msgstr "این متد را میتوان به تعداد دفعات دلخواه، تا زمانی که یک اتصال باز است، فراخوانی کرد."
msgid "However, :meth:`protocol.eof_received() <Protocol.eof_received>` is called at most once. Once ``eof_received()`` is called, ``data_received()`` is not called anymore."
msgstr "با این حال، :meth:`protocol.eof_received() <Protocol.eof_received>` حداکثر یکبار فراخوانی میشود. پس از فراخوانی ``eof_received()``، دیگر ``data_received()`` فراخوانی نمیشود."
msgid "Called when the other end signals it won't send any more data (for example by calling :meth:`transport.write_eof() <WriteTransport.write_eof>`, if the other end also uses asyncio)."
msgstr "هنگامی فراخوانی میشود که طرف مقابل اعلام کند دیگر دادهای ارسال نخواهد کرد (برای مثال با فراخوانی :meth:`transport.write_eof() <WriteTransport.write_eof>`، اگر طرف مقابل نیز از asyncio استفاده کند)."
msgid "This method may return a false value (including ``None``), in which case the transport will close itself. Conversely, if this method returns a true value, the protocol used determines whether to close the transport. Since the default implementation returns ``None``, it implicitly closes the connection."
msgstr "این متد ممکن است یک مقدار نادرست (از جمله ``None``) برگرداند، که در این صورت انتقالخود بسته خواهد شد. در مقابل، اگر این متد یک مقدار درست برگرداند، پروتکل استفادهشده تعیین میکند که آیا انتقالبسته شود یا خیر. از آنجا که پیادهسازی پیشفرض ``None`` را برمیگرداند، بهطور ضمنی اتصال را میبندد."
msgid "Some transports, including SSL, don't support half-closed connections, in which case returning true from this method will result in the connection being closed."
msgstr "برخی انتقالها، از جمله SSL، از اتصالهای نیمهبسته پشتیبانی نمیکنند؛ در این صورت، برگرداندن true از این متد منجر به بسته شدن اتصال خواهد شد."
msgid "State machine:"
msgstr "ماشین حالت:"
msgid ""
"start -> connection_made\n"
" [-> data_received]*\n"
" [-> eof_received]?\n"
"-> connection_lost -> end"
msgstr ""
"start -> connection_made\n"
" [-> data_received]*\n"
" [-> eof_received]?\n"
"-> connection_lost -> end"
msgid "Buffered Streaming Protocols"
msgstr "پروتکلهای جریان بافرشده"
msgid "Buffered Protocols can be used with any event loop method that supports `Streaming Protocols`_."
msgstr "میتوان از پروتکلهای بافری با هر متدی از حلقه رویداد که از `Streaming Protocols`_ پشتیبانی میکند، استفاده کرد."
msgid "``BufferedProtocol`` implementations allow explicit manual allocation and control of the receive buffer. Event loops can then use the buffer provided by the protocol to avoid unnecessary data copies. This can result in noticeable performance improvement for protocols that receive big amounts of data. Sophisticated protocol implementations can significantly reduce the number of buffer allocations."
msgstr "پیادهسازیهای ``BufferedProtocol`` امکان تخصیص و کنترل دستی صریح بافر دریافت را فراهم میکنند. حلقههای رویداد میتوانند سپس از بافر فراهمشده توسط پروتکل برای اجتناب از کپیهای غیرضروری داده استفاده کنند. این موضوع میتواند منجر به بهبود محسوس کارایی برای پروتکلهایی شود که حجم زیادی از داده را دریافت میکنند. پیادهسازیهای پیشرفتهی پروتکل میتوانند تعداد تخصیصهای بافر را بهطور قابلتوجهی کاهش دهند."
msgid "The following callbacks are called on :class:`BufferedProtocol` instances:"
msgstr "کالبکهای زیر بر روی نمونههای :class:`BufferedProtocol` فراخوانی میشوند:"
msgid "Called to allocate a new receive buffer."
msgstr "برای تخصیص یک بافر دریافت جدید فراخوانی میشود."
msgid "*sizehint* is the recommended minimum size for the returned buffer. It is acceptable to return smaller or larger buffers than what *sizehint* suggests. When set to -1, the buffer size can be arbitrary. It is an error to return a buffer with a zero size."
msgstr "*sizehint* حداقل اندازهی پیشنهادی برای بافر برگرداندهشده است. بازگرداندن بافرهای کوچکتر یا بزرگتر از آنچه *sizehint* پیشنهاد میدهد، مجاز است. هنگامی که روی -1 تنظیم شود، اندازهی بافر میتواند دلخواه باشد. بازگرداندن بافری با اندازهی صفر خطا است."
msgid "``get_buffer()`` must return an object implementing the :ref:`buffer protocol <bufferobjects>`."
msgstr "``get_buffer()`` باید شیءای را برگرداند که :ref:`پروتکل بافر <bufferobjects>` را پیادهسازی کند."
msgid "Called when the buffer was updated with the received data."
msgstr "هنگامی که بافر با دادههای دریافتی بهروزرسانی شد، فراخوانی میشود."
msgid "*nbytes* is the total number of bytes that were written to the buffer."
msgstr "*nbytes* تعداد کل بایتهایی است که در بافر نوشته شدهاند."
msgid "See the documentation of the :meth:`protocol.eof_received() <Protocol.eof_received>` method."
msgstr "مستندات متد :meth:`protocol.eof_received() <Protocol.eof_received>` را ببینید."
msgid ":meth:`~BufferedProtocol.get_buffer` can be called an arbitrary number of times during a connection. However, :meth:`protocol.eof_received() <Protocol.eof_received>` is called at most once and, if called, :meth:`~BufferedProtocol.get_buffer` and :meth:`~BufferedProtocol.buffer_updated` won't be called after it."
msgstr ":meth:`~BufferedProtocol.get_buffer` میتواند تعداد دلخواهی بار در طول یک اتصال فراخوانی شود. با این حال، :meth:`protocol.eof_received() <Protocol.eof_received>` حداکثر یک بار فراخوانی میشود و در صورت فراخوانی، پس از آن :meth:`~BufferedProtocol.get_buffer` و :meth:`~BufferedProtocol.buffer_updated` فراخوانی نخواهند شد."
msgid ""
"start -> connection_made\n"
" [-> get_buffer\n"
" [-> buffer_updated]?\n"
" ]*\n"
" [-> eof_received]?\n"
"-> connection_lost -> end"
msgstr ""
"start -> connection_made\n"
" [-> get_buffer\n"
" [-> buffer_updated]?\n"
" ]*\n"
" [-> eof_received]?\n"
"-> connection_lost -> end"
msgid "Datagram Protocols"
msgstr "پروتکلهای دیتاگرام"
msgid "Datagram Protocol instances should be constructed by protocol factories passed to the :meth:`loop.create_datagram_endpoint` method."
msgstr "نمونههای پروتکل دیتاگرام (Datagram Protocol) باید توسط کارخانههای پروتکل (protocol factories) که به متد :meth:`loop.create_datagram_endpoint` داده میشوند، ساخته شوند."
msgid "Called when a datagram is received. *data* is a bytes object containing the incoming data. *addr* is the address of the peer sending the data; the exact format depends on the transport."
msgstr "هنگام دریافت یک دیتاگرام فراخوانی میشود. *data* یک شیء bytes حاوی دادههای دریافتی است. *addr* نشانی همتای ارسالکنندهی دادهها است؛ قالب دقیق آن به انتقالبستگی دارد."
msgid "Called when a previous send or receive operation raises an :class:`OSError`. *exc* is the :class:`OSError` instance."
msgstr "هنگامی که یک عملیات ارسال یا دریافت پیشین یک :class:`OSError` را پرتاب کند، فراخوانی میشود. *exc* یک نمونه از :class:`OSError` است."
msgid "This method is called in rare conditions, when the transport (e.g. UDP) detects that a datagram could not be delivered to its recipient. In many conditions though, undeliverable datagrams will be silently dropped."
msgstr "این متد در شرایط نادر فراخوانی میشود، زمانی که انتقال (مثلاً UDP) تشخیص دهد که یک دیتاگرام نتوانسته است به گیرنده خود تحویل داده شود. هرچند در بسیاری از شرایط، دیتاگرامهای غیرقابلتحویل بهصورت خاموش دور انداخته میشوند."
msgid "On BSD systems (macOS, FreeBSD, etc.) flow control is not supported for datagram protocols, because there is no reliable way to detect send failures caused by writing too many packets."
msgstr "در سیستمهای BSD (macOS، FreeBSD و غیره) کنترل جریان برای پروتکلهای دیتاگرام پشتیبانی نمیشود، زیرا روش قابلاطمینانی برای تشخیص شکستهای ارسال ناشی از نوشتن تعداد بیشازحد بسته وجود ندارد."
msgid "The socket always appears 'ready' and excess packets are dropped. An :class:`OSError` with ``errno`` set to :const:`errno.ENOBUFS` may or may not be raised; if it is raised, it will be reported to :meth:`DatagramProtocol.error_received` but otherwise ignored."
msgstr "سوکت همیشه «آماده» به نظر میرسد و بستههای مازاد دور انداخته میشوند. ممکن است یک :class:`OSError` با ``errno`` تنظیمشده روی :const:`errno.ENOBUFS` پرتاب شود یا نشود؛ اگر پرتاب شود، به :meth:`DatagramProtocol.error_received` گزارش میشود اما در غیر این صورت نادیده گرفته میشود."
msgid "Subprocess Protocols"
msgstr "پروتکلهای زیرفرایند"
msgid "Subprocess Protocol instances should be constructed by protocol factories passed to the :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods."
msgstr "نمونههای پروتکل زیرفرایند باید بهوسیلهی کارخانههای پروتکل دادهشده به متدهای :meth:`loop.subprocess_exec` و :meth:`loop.subprocess_shell` ساخته شوند."
msgid "Called when the child process writes data into its stdout or stderr pipe."
msgstr "هنگامی فراخوانی میشود که فرایند فرزند دادهای را در پایپ stdout یا stderr خود بنویسد."
msgid "*fd* is the integer file descriptor of the pipe."
msgstr "*fd* توصیفگر پرونده عدد صحیحِ پایپ است."
msgid "*data* is a non-empty bytes object containing the received data."
msgstr "*data* یک شیء bytes غیرخالی حاوی دادههای دریافتی است."
msgid "Called when one of the pipes communicating with the child process is closed."
msgstr "هنگامی فراخوانی میشود که یکی از پایپهای ارتباطی با فرایند فرزند بسته شود."
msgid "*fd* is the integer file descriptor that was closed."
msgstr "*fd* توصیفگر پرونده از نوع عدد صحیح است که بسته شده است."
msgid "Called when the child process has exited."
msgstr "هنگامی فراخوانی میشود که فرایند فرزند خارج شده باشد."
msgid "It can be called before :meth:`~SubprocessProtocol.pipe_data_received` and :meth:`~SubprocessProtocol.pipe_connection_lost` methods."
msgstr "میتوان آن را پیش از متدهای :meth:`~SubprocessProtocol.pipe_data_received` و :meth:`~SubprocessProtocol.pipe_connection_lost` فراخوانی کرد."
msgid "Examples"
msgstr "مثالها"
msgid "TCP Echo Server"
msgstr "سرور اکو TCP"
msgid "Create a TCP echo server using the :meth:`loop.create_server` method, send back received data, and close the connection::"
msgstr "با استفاده از متد :meth:`loop.create_server` یک سرور اکوی TCP ایجاد کنید، دادههای دریافتی را بازگردانید و اتصال را ببندید::"
msgid ""
"import asyncio\n"
"\n"
"\n"
"class EchoServerProtocol(asyncio.Protocol):\n"
" def connection_made(self, transport):\n"
" peername = transport.get_extra_info('peername')\n"
" print('Connection from {}'.format(peername))\n"
" self.transport = transport\n"
"\n"
" def data_received(self, data):\n"
" message = data.decode()\n"
" print('Data received: {!r}'.format(message))\n"
"\n"
" print('Send: {!r}'.format(message))\n"
" self.transport.write(data)\n"
"\n"
" print('Close the client socket')\n"
" self.transport.close()\n"
"\n"
"\n"
"async def main():\n"
" # Get a reference to the event loop as we plan to use\n"
" # low-level APIs.\n"
" loop = asyncio.get_running_loop()\n"
"\n"
" server = await loop.create_server(\n"
" EchoServerProtocol,\n"
" '127.0.0.1', 8888)\n"
"\n"
" async with server:\n"
" await server.serve_forever()\n"
"\n"
"\n"
"asyncio.run(main())"
msgstr ""
"import asyncio\n"
"\n"
"\n"
"class EchoServerProtocol(asyncio.Protocol):\n"
" def connection_made(self, transport):\n"
" peername = transport.get_extra_info('peername')\n"
" print('Connection from {}'.format(peername))\n"
" self.transport = transport\n"
"\n"
" def data_received(self, data):\n"
" message = data.decode()\n"
" print('Data received: {!r}'.format(message))\n"
"\n"
" print('Send: {!r}'.format(message))\n"
" self.transport.write(data)\n"
"\n"
" print('Close the client socket')\n"
" self.transport.close()\n"
"\n"
"\n"
"async def main():\n"
" # Get a reference to the event loop as we plan to use\n"
" # low-level APIs.\n"
" loop = asyncio.get_running_loop()\n"
"\n"
" server = await loop.create_server(\n"
" EchoServerProtocol,\n"
" '127.0.0.1', 8888)\n"
"\n"
" async with server:\n"
" await server.serve_forever()\n"
"\n"
"\n"
"asyncio.run(main())"
msgid "The :ref:`TCP echo server using streams <asyncio-tcp-echo-server-streams>` example uses the high-level :func:`asyncio.start_server` function."
msgstr "مثال :ref:`سرور اکوی TCP با استفاده از جریانها <asyncio-tcp-echo-server-streams>` از تابع سطح بالای :func:`asyncio.start_server` استفاده میکند."
msgid "TCP Echo Client"
msgstr "کلاینتی پژواک TCP"
msgid "A TCP echo client using the :meth:`loop.create_connection` method, sends data, and waits until the connection is closed::"
msgstr "یک کلاینت اکوی TCP با استفاده از متد :meth:`loop.create_connection`، داده ارسال میکند و منتظر میماند تا اتصال بسته شود::"
msgid ""
"import asyncio\n"
"\n"
"\n"
"class EchoClientProtocol(asyncio.Protocol):\n"
" def __init__(self, message, on_con_lost):\n"
" self.message = message\n"
" self.on_con_lost = on_con_lost\n"
"\n"
" def connection_made(self, transport):\n"
" transport.write(self.message.encode())\n"
" print('Data sent: {!r}'.format(self.message))\n"
"\n"
" def data_received(self, data):\n"
" print('Data received: {!r}'.format(data.decode()))\n"
"\n"
" def connection_lost(self, exc):\n"
" print('The server closed the connection')\n"
" self.on_con_lost.set_result(True)\n"
"\n"
"\n"
"async def main():\n"
" # Get a reference to the event loop as we plan to use\n"
" # low-level APIs.\n"
" loop = asyncio.get_running_loop()\n"
"\n"
" on_con_lost = loop.create_future()\n"
" message = 'Hello World!'\n"
"\n"
" transport, protocol = await loop.create_connection(\n"
" lambda: EchoClientProtocol(message, on_con_lost),\n"
" '127.0.0.1', 8888)\n"
"\n"
" # Wait until the protocol signals that the connection\n"
" # is lost and close the transport.\n"
" try:\n"
" await on_con_lost\n"
" finally:\n"
" transport.close()\n"
"\n"
"\n"
"asyncio.run(main())"
msgstr ""
"import asyncio\n"
"\n"
"\n"
"class EchoClientProtocol(asyncio.Protocol):\n"
" def __init__(self, message, on_con_lost):\n"
" self.message = message\n"
" self.on_con_lost = on_con_lost\n"
"\n"
" def connection_made(self, transport):\n"
" transport.write(self.message.encode())\n"
" print('Data sent: {!r}'.format(self.message))\n"
"\n"
" def data_received(self, data):\n"
" print('Data received: {!r}'.format(data.decode()))\n"
"\n"
" def connection_lost(self, exc):\n"
" print('The server closed the connection')\n"
" self.on_con_lost.set_result(True)\n"
"\n"
"\n"
"async def main():\n"
" # Get a reference to the event loop as we plan to use\n"
" # low-level APIs.\n"
" loop = asyncio.get_running_loop()\n"
"\n"
" on_con_lost = loop.create_future()\n"
" message = 'Hello World!'\n"
"\n"
" transport, protocol = await loop.create_connection(\n"
" lambda: EchoClientProtocol(message, on_con_lost),\n"
" '127.0.0.1', 8888)\n"
"\n"
" # Wait until the protocol signals that the connection\n"
" # is lost and close the transport.\n"
" try:\n"
" await on_con_lost\n"
" finally:\n"
" transport.close()\n"
"\n"
"\n"
"asyncio.run(main())"
msgid "The :ref:`TCP echo client using streams <asyncio-tcp-echo-client-streams>` example uses the high-level :func:`asyncio.open_connection` function."
msgstr "مثال :ref:`TCP echo client using streams <asyncio-tcp-echo-client-streams>` از تابع سطح بالای :func:`asyncio.open_connection` استفاده میکند."
msgid "UDP Echo Server"
msgstr "سرور پژواک UDP"
msgid "A UDP echo server, using the :meth:`loop.create_datagram_endpoint` method, sends back received data::"
msgstr "یک سرور اکو UDP، با استفاده از متد :meth:`loop.create_datagram_endpoint`، دادههای دریافتی را بازمیگرداند::"
msgid ""
"import asyncio\n"
"\n"
"\n"
"class EchoServerProtocol:\n"
" def connection_made(self, transport):\n"
" self.transport = transport\n"
"\n"
" def datagram_received(self, data, addr):\n"
" message = data.decode()\n"
" print('Received %r from %s' % (message, addr))\n"
" print('Send %r to %s' % (message, addr))\n"
" self.transport.sendto(data, addr)\n"
"\n"
"\n"
"async def main():\n"
" print(\"Starting UDP server\")\n"
"\n"
" # Get a reference to the event loop as we plan to use\n"
" # low-level APIs.\n"
" loop = asyncio.get_running_loop()\n"
"\n"
" # One protocol instance will be created to serve all\n"
" # client requests.\n"
" transport, protocol = await loop.create_datagram_endpoint(\n"
" EchoServerProtocol,\n"
" local_addr=('127.0.0.1', 9999))\n"
"\n"
" try:\n"
" await asyncio.sleep(3600) # Serve for 1 hour.\n"
" finally:\n"
" transport.close()\n"
"\n"
"\n"
"asyncio.run(main())"
msgstr ""
"import asyncio\n"
"\n"
"\n"
"class EchoServerProtocol:\n"
" def connection_made(self, transport):\n"
" self.transport = transport\n"
"\n"
" def datagram_received(self, data, addr):\n"
" message = data.decode()\n"
" print('Received %r from %s' % (message, addr))\n"
" print('Send %r to %s' % (message, addr))\n"
" self.transport.sendto(data, addr)\n"
"\n"
"\n"
"async def main():\n"
" print(\"Starting UDP server\")\n"
"\n"
" # Get a reference to the event loop as we plan to use\n"
" # low-level APIs.\n"
" loop = asyncio.get_running_loop()\n"
"\n"
" # One protocol instance will be created to serve all\n"
" # client requests.\n"
" transport, protocol = await loop.create_datagram_endpoint(\n"
" EchoServerProtocol,\n"
" local_addr=('127.0.0.1', 9999))\n"
"\n"
" try:\n"
" await asyncio.sleep(3600) # Serve for 1 hour.\n"
" finally:\n"
" transport.close()\n"
"\n"
"\n"
"asyncio.run(main())"
msgid "UDP Echo Client"
msgstr "کلاینت پژواک UDP"
msgid "A UDP echo client, using the :meth:`loop.create_datagram_endpoint` method, sends data and closes the transport when it receives the answer::"
msgstr "یک کلاینت پژواک UDP، با استفاده از متد :meth:`loop.create_datagram_endpoint`، دادهها را ارسال میکند و هنگامی که پاسخ را دریافت میکند، انتقال را میبندد::"
msgid ""
"import asyncio\n"
"\n"
"\n"
"class EchoClientProtocol:\n"
" def __init__(self, message, on_con_lost):\n"
" self.message = message\n"
" self.on_con_lost = on_con_lost\n"
" self.transport = None\n"
"\n"
" def connection_made(self, transport):\n"
" self.transport = transport\n"
" print('Send:', self.message)\n"
" self.transport.sendto(self.message.encode())\n"
"\n"
" def datagram_received(self, data, addr):\n"
" print(\"Received:\", data.decode())\n"
"\n"
" print(\"Close the socket\")\n"
" self.transport.close()\n"
"\n"
" def error_received(self, exc):\n"
" print('Error received:', exc)\n"
"\n"
" def connection_lost(self, exc):\n"
" print(\"Connection closed\")\n"
" self.on_con_lost.set_result(True)\n"
"\n"
"\n"
"async def main():\n"
" # Get a reference to the event loop as we plan to use\n"
" # low-level APIs.\n"
" loop = asyncio.get_running_loop()\n"
"\n"
" on_con_lost = loop.create_future()\n"
" message = \"Hello World!\"\n"
"\n"
" transport, protocol = await loop.create_datagram_endpoint(\n"
" lambda: EchoClientProtocol(message, on_con_lost),\n"
" remote_addr=('127.0.0.1', 9999))\n"
"\n"
" try:\n"
" await on_con_lost\n"
" finally:\n"
" transport.close()\n"
"\n"
"\n"
"asyncio.run(main())"
msgstr ""
"import asyncio\n"
"\n"
"\n"
"class EchoClientProtocol:\n"
" def __init__(self, message, on_con_lost):\n"
" self.message = message\n"
" self.on_con_lost = on_con_lost\n"
" self.transport = None\n"
"\n"
" def connection_made(self, transport):\n"
" self.transport = transport\n"
" print('Send:', self.message)\n"
" self.transport.sendto(self.message.encode())\n"
"\n"
" def datagram_received(self, data, addr):\n"
" print(\"Received:\", data.decode())\n"
"\n"
" print(\"Close the socket\")\n"
" self.transport.close()\n"
"\n"
" def error_received(self, exc):\n"
" print('Error received:', exc)\n"
"\n"
" def connection_lost(self, exc):\n"
" print(\"Connection closed\")\n"
" self.on_con_lost.set_result(True)\n"
"\n"
"\n"
"async def main():\n"
" # Get a reference to the event loop as we plan to use\n"
" # low-level APIs.\n"
" loop = asyncio.get_running_loop()\n"
"\n"
" on_con_lost = loop.create_future()\n"
" message = \"Hello World!\"\n"
"\n"
" transport, protocol = await loop.create_datagram_endpoint(\n"
" lambda: EchoClientProtocol(message, on_con_lost),\n"
" remote_addr=('127.0.0.1', 9999))\n"
"\n"
" try:\n"
" await on_con_lost\n"
" finally:\n"
" transport.close()\n"
"\n"
"\n"
"asyncio.run(main())"
msgid "Connecting Existing Sockets"
msgstr "اتصال سوکتهای موجود"
msgid "Wait until a socket receives data using the :meth:`loop.create_connection` method with a protocol::"
msgstr "با استفاده از متد :meth:`loop.create_connection` بههمراه یک پروتکل، منتظر بمانید تا یک سوکت دادهای دریافت کند::"
msgid ""
"import asyncio\n"
"import socket\n"
"\n"
"\n"
"class MyProtocol(asyncio.Protocol):\n"
"\n"
" def __init__(self, on_con_lost):\n"
" self.transport = None\n"
" self.on_con_lost = on_con_lost\n"
"\n"
" def connection_made(self, transport):\n"
" self.transport = transport\n"
"\n"
" def data_received(self, data):\n"
" print(\"Received:\", data.decode())\n"
"\n"
" # We are done: close the transport;\n"
" # connection_lost() will be called automatically.\n"
" self.transport.close()\n"
"\n"
" def connection_lost(self, exc):\n"
" # The socket has been closed\n"
" self.on_con_lost.set_result(True)\n"
"\n"
"\n"
"async def main():\n"
" # Get a reference to the event loop as we plan to use\n"
" # low-level APIs.\n"
" loop = asyncio.get_running_loop()\n"
" on_con_lost = loop.create_future()\n"
"\n"
" # Create a pair of connected sockets\n"
" rsock, wsock = socket.socketpair()\n"
"\n"
" # Register the socket to wait for data.\n"
" transport, protocol = await loop.create_connection(\n"
" lambda: MyProtocol(on_con_lost), sock=rsock)\n"
"\n"
" # Simulate the reception of data from the network.\n"
" loop.call_soon(wsock.send, 'abc'.encode())\n"
"\n"
" try:\n"
" await protocol.on_con_lost\n"
" finally:\n"
" transport.close()\n"
" wsock.close()\n"
"\n"
"asyncio.run(main())"
msgstr ""
"import asyncio\n"
"import socket\n"
"\n"
"\n"
"class MyProtocol(asyncio.Protocol):\n"
"\n"
" def __init__(self, on_con_lost):\n"
" self.transport = None\n"
" self.on_con_lost = on_con_lost\n"
"\n"
" def connection_made(self, transport):\n"
" self.transport = transport\n"
"\n"
" def data_received(self, data):\n"
" print(\"Received:\", data.decode())\n"
"\n"
" # We are done: close the transport;\n"
" # connection_lost() will be called automatically.\n"
" self.transport.close()\n"
"\n"
" def connection_lost(self, exc):\n"
" # The socket has been closed\n"
" self.on_con_lost.set_result(True)\n"
"\n"
"\n"
"async def main():\n"
" # Get a reference to the event loop as we plan to use\n"
" # low-level APIs.\n"