summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/selector_events.py
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-31819: Add AbstractEventLoop.sock_recv_into() (#4051)Antoine Pitrou2017-10-191-0/+35
| | | | | | | | * bpo-31819: Add AbstractEventLoop.sock_recv_into() * Add NEWS * Add doc
* bpo-29617: Remove Python 3.3 support from asyncio (GH-232)INADA Naoki2017-04-251-10/+5
|
* Merge 3.5 (issue #28369)Yury Selivanov2016-10-051-48/+79
|\
| * Issue #28369: Raise an error when transport's FD is used with add_readerYury Selivanov2016-10-051-48/+79
| |
* | Merge 3.5 (issue #28176)Yury Selivanov2016-09-151-17/+10
|\ \ | |/
| * Issue #28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect.Yury Selivanov2016-09-151-17/+10
| |
* | Merge 3.5 (issue #27906)Yury Selivanov2016-09-151-33/+40
|\ \ | |/
| * Issue #27906: Fix socket accept exhaustion during high TCP traffic.Yury Selivanov2016-09-151-33/+40
| | | | | | | | Patch by Kevin Conway.
* | Merge 3.5 (issue #27456)Yury Selivanov2016-09-121-0/+16
|\ \ | |/
| * Issue #27456: asyncio: Set TCP_NODELAY by default.Yury Selivanov2016-09-121-0/+16
| |
* | Merge 3.5 (asyncio)Yury Selivanov2016-09-121-0/+6
|\ \ | |/
| * asyncio: Add set_protocol / get_protocol methods to TransportsYury Selivanov2016-09-121-0/+6
| |
* | Merge 3.5 (asyncio)Yury Selivanov2016-06-281-1/+2
|\ \ | |/
| * asyncio: Use socket specs for getaddrinfo() in sock_connect()Yury Selivanov2016-06-281-1/+2
| | | | | | | | Patch by Martin Richard. GH PR #365.
* | Merge 3.5 (issue #27223)Yury Selivanov2016-06-111-0/+11
|\ \ | |/
| * Issue #27223: aio: Fix _read_ready and _write_ready to respect _conn_lost.Yury Selivanov2016-06-111-0/+11
| | | | | | | | Patch by Ɓukasz Langa.
* | Merge 3.5 (issue #27136, asyncio)Yury Selivanov2016-06-081-10/+14
|\ \ | |/
| * Issue #27136: Fix DNS static resolution; don't use it in getaddrinfoYury Selivanov2016-06-081-10/+14
| | | | | | | | Patch by A. Jesse Jiryu Davis
* | Merge 3.5 (Issue #27041)Yury Selivanov2016-05-161-5/+5
|\ \ | |/
| * Issue #27041: asyncio: Add loop.create_future methodYury Selivanov2016-05-161-5/+5
| |
* | Issue #26778: Fixed "a/an/and" typos in code comment, documentation and errorSerhiy Storchaka2016-04-171-1/+1
|\ \ | |/ | | | | messages.
| * Issue #26778: Fixed "a/an/and" typos in code comment and documentation.Serhiy Storchaka2016-04-171-1/+1
| |
* | Merge 3.5 (asyncio)Victor Stinner2016-04-011-2/+1
|\ \ | |/
| * asyncio: Don't log ConnectionAbortedErrorVictor Stinner2016-04-011-2/+1
| | | | | | | | | | Issue #26509: In fatal error handlers, don't log ConnectionAbortedError which occur on Windows.
* | Add a source parameter to warnings.warn()Victor Stinner2016-03-221-1/+2
|/ | | | | | | | Issue #26604: * Add a new optional source parameter to _warnings.warn() and warnings.warn() * Modify asyncore, asyncio and _pyio modules to set the source parameter when logging a ResourceWarning warning
* Fix error message in asyncio.selector_events.Victor Stinner2016-02-011-6/+6
| | | | Patch written by Carlo Beccarini <hackdiablo.cb@gmail.com>.
* asyncio: Skip getaddrinfo if host is already resolved.Yury Selivanov2015-12-171-2/+1
| | | | | | | | | | | | | getaddrinfo takes an exclusive lock on some platforms, causing clients to queue up waiting for the lock if many names are being resolved concurrently. Users may want to handle name resolution in their own code, for the sake of caching, using an alternate resolver, or to measure DNS duration separately from connection duration. Skip getaddrinfo if the "host" passed into create_connection is already resolved. See https://github.com/python/asyncio/pull/302 for details. Patch by A. Jesse Jiryu Davis.
* asyncio: Cleanup Future APIYury Selivanov2015-11-171-2/+4
| | | | See https://github.com/python/asyncio/pull/292 for details.
* asyncio: Add Transport.is_closing()Yury Selivanov2015-11-161-0/+3
| | | | See https://github.com/python/asyncio/pull/291 for details.
* Issue #25114, asyncio: add ssl_object extra info to SSL transportsVictor Stinner2015-09-211-0/+1
| | | | | | This info is required on Python 3.5 and newer to get specific information on the SSL object, like getting the binary peer certificate (instead of getting it as text).
* asyncio: Sync with upstream (compat module)Yury Selivanov2015-08-041-2/+2
|
* Issue #23879, asyncio: SelectorEventLoop.sock_connect() must not call connect()Victor Stinner2015-04-071-8/+6
| | | | | | | | again if the first call to connect() raises an InterruptedError. When the C function connect() fails with EINTR, the connection runs in background. We have to wait until the socket becomes writable to be notified when the connection succeed or fails.
* asyncio: Fix _SelectorTransport.__repr__() if the event loop is closedVictor Stinner2015-03-271-1/+1
|
* asyncio: Only call _check_resolved_address() in debug modeVictor Stinner2015-02-041-1/+2
| | | | | | | | | | | | | | | | * _check_resolved_address() is implemented with getaddrinfo() which is slow * If available, use socket.inet_pton() instead of socket.getaddrinfo(), because it is much faster Microbenchmark (timeit) on Fedora 21 (Python 3.4, Linux 3.17, glibc 2.20) to validate the IPV4 address "127.0.0.1" or the IPv6 address "::1": * getaddrinfo() 10.4 usec per loop * inet_pton(): 0.285 usec per loop On glibc older than 2.14, getaddrinfo() always requests the list of all local IP addresses to the kernel (using a NETLINK socket). getaddrinfo() has other known issues, it's better to avoid it when it is possible.
* asyncio: BaseSelectorEventLoop uses directly the private _debug attributeVictor Stinner2015-02-041-5/+5
| | | | | Just try to be consistent: _debug was already used in some places, and always used in BaseProactorEventLoop.
* Issue #23243, asyncio: Emit a ResourceWarning when an event loop or a transportVictor Stinner2015-01-291-0/+16
| | | | is not explicitly closed. Close also explicitly transports in test_sslproto.
* asyncio: sync with TulipVictor Stinner2015-01-291-6/+38
| | | | | | | | | * Cleanup gather(): use cancelled() method instead of using private Future attribute * Fix _UnixReadPipeTransport and _UnixWritePipeTransport. Only start reading when connection_made() has been called. * Issue #23333: Fix BaseSelectorEventLoop._accept_connection(). Close the transport on error. In debug mode, log errors using call_exception_handler()
* asyncio: sync with TulipVictor Stinner2015-01-291-3/+10
| | | | | | | | | | * _SelectorTransport constructor: extra parameter is now optional * Fix _SelectorDatagramTransport constructor. Only start reading after connection_made() has been called. * Fix _SelectorSslTransport.close(). Don't call protocol.connection_lost() if protocol.connection_made() was not called yet: if the SSL handshake failed or is still in progress. The close() method can be called if the creation of the connection is cancelled, by a timeout for example.
* asyncio: Fix _SelectorSocketTransport constructorVictor Stinner2015-01-281-1/+3
| | | | | Only start reading when connection_made() has been called: protocol.data_received() must not be called before protocol.connection_made().
* asyncio: SSL transports now clear their reference to the waiterVictor Stinner2015-01-281-11/+16
| | | | | | | * Rephrase also the comment explaining why the waiter is not awaken immediatly. * SSLProtocol.eof_received() doesn't instanciate ConnectionResetError exception directly, it will be done by Future.set_exception(). The exception is not used if the waiter was cancelled or if there is no waiter.
* asyncio: pyflakes, remove unused importVictor Stinner2015-01-211-1/+0
| | | | tests: Remove unused function; inline another function
* asyncio: sync with TulipVictor Stinner2015-01-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | * PipeHandle now uses None instead of -1 for a closed handle * Sort imports in windows_utils. * Fix test_events on Python older than 3.5. Skip SSL tests on the ProactorEventLoop if ssl.MemoryIO is missing * Fix BaseEventLoop._create_connection_transport(). Close the transport if the creation of the transport (if the waiter) gets an exception. * _ProactorBasePipeTransport now sets _sock to None when the transport is closed. * Fix BaseSubprocessTransport.close(). Ignore pipes for which the protocol is not set yet (still equal to None). * TestLoop.close() now calls the close() method of the parent class (BaseEventLoop). * Cleanup BaseSelectorEventLoop: create the protocol on a separated line for readability and ease debugging. * Fix BaseSubprocessTransport._kill_wait(). Set the _returncode attribute, so close() doesn't try to terminate the process. * Tests: explicitly close event loops and transports * UNIX pipe transports: add closed/closing in repr(). Add "closed" or "closing" state in the __repr__() method of _UnixReadPipeTransport and _UnixWritePipeTransport classes.
* Issue #23197: On SSL handshake failure on matching hostname, check if theVictor Stinner2015-01-141-1/+2
| | | | waiter is cancelled before setting its exception.
* Issue #23197, asyncio: On SSL handshake failure, check if the waiter isVictor Stinner2015-01-141-1/+1
| | | | | | | cancelled before setting its exception. * Add unit tests for this case. * Cleanup also sslproto.py
* Issue #22560: New SSL implementation based on ssl.MemoryBIOVictor Stinner2015-01-131-21/+24
| | | | | | | | | | | | | | | | | | | The new SSL implementation is based on the new ssl.MemoryBIO which is only available on Python 3.5. On Python 3.4 and older, the legacy SSL implementation (using SSL_write, SSL_read, etc.) is used. The proactor event loop only supports the new implementation. The new asyncio.sslproto module adds _SSLPipe, SSLProtocol and _SSLProtocolTransport classes. _SSLPipe allows to "wrap" or "unwrap" a socket (switch between cleartext and SSL/TLS). Patch written by Antoine Pitrou. sslproto.py is based on gruvi/ssl.py of the gruvi project written by Geert Jansen. This change adds SSL support to ProactorEventLoop on Python 3.5 and newer! It becomes also possible to implement STARTTTLS: switch a cleartext socket to SSL.
* asyncio: sync with TulipVictor Stinner2015-01-091-1/+0
| | | | | | | * Tulip issue 184: FlowControlMixin constructor now get the event loop if the loop parameter is not set. Add unit tests to ensure that constructor of StreamReader and StreamReaderProtocol classes get the event loop. * Remove outdated TODO/XXX
* asyncio: sync with TulipVictor Stinner2015-01-091-3/+3
| | | | | | | | * Document why set_result() calls are safe * Cleanup gather(). Use public methods instead of hacks to consume the exception of a future. * sock_connect(): pass directly the fd to _sock_connect_done instead of the socket.
* asyncio: Truncate to 80 columnsVictor Stinner2015-01-081-3/+4
|
* asyncio: _make_ssl_transport: make the waiter parameter optionalVictor Stinner2015-01-081-2/+2
|
* Issue #22926: In debug mode, call_soon(), call_at() and call_later() methods ofVictor Stinner2014-12-261-1/+1
| | | | | | | | | | asyncio.BaseEventLoop now use the identifier of the current thread to ensure that they are called from the thread running the event loop. Before, the get_event_loop() method was used to check the thread, and no exception was raised when the thread had no event loop. Now the methods always raise an exception in debug mode when called from the wrong thread. It should help to notice misusage of the API.