twisted.internet.tcpView Source (View In Hierarchy)
Known implementations: twisted.internet.tcp._FileDescriptorReservation, twisted.internet.tcp._NullFileDescriptorReservation
An open file that represents an emergency reservation in the process'
file descriptor table. If
accept(2), it can close this file
descriptor, retry the
accept so that the incoming connection
occupies this file descriptor's space, and then close that connection and
reopen this one.
attempts to open the reserve file descriptor if it is not already open.
if the underlying file is open and its descriptor claimed.
instances are context managers; entering them releases the underlying file
descriptor, while exiting them attempts to reacquire it. The block can
take advantage of the free slot in the process' file descriptor table
accept and close a client connection.
Because another thread might open a file descriptor between the time the
context manager is entered and the time
accept is called,
opening the reserve descriptor is best-effort only.
|Method||available||Is the reservation available?|
|Method||reserve||Attempt to open the reserved file descriptor; if this fails because of
|Method||__enter__||Release the underlying file descriptor so that code within the context manager can open a new file.|
|Method||__exit__||Attempt to re-open the reserved file descriptor. See
Release the underlying file descriptor so that code within the context manager can open a new file.