class StandardIO(_pollingfile._PollingTimer): (source)
Constructor: StandardIO(proto, reactor)
Implements interfaces: twisted.internet.interfaces.IConsumer
, twisted.internet.interfaces.IPushProducer
, twisted.internet.interfaces.ITransport
Undocumented
Method | __init__ |
Start talking to standard IO with the given protocol. |
Method | check |
Undocumented |
Method | data |
Undocumented |
Method | get |
Similar to getPeer, but returns an address describing this side of the connection. |
Method | get |
Get the remote address of this connection. |
Method | lose |
Close my connection, after writing all pending data. |
Method | pause |
Pause producing data. |
Method | read |
Undocumented |
Method | register |
Register to receive data from a producer. |
Method | resume |
Resume producing data. |
Method | stop |
Stop producing data. |
Method | unregister |
Stop consuming data from a producer, without disconnecting. |
Method | write |
Write some data to the physical connection, in sequence, in a non-blocking fashion. |
Method | write |
Undocumented |
Method | write |
Write an iterable of byte strings to the physical connection. |
Class Variable | conns |
Undocumented |
Instance Variable | disconnected |
Undocumented |
Instance Variable | disconnecting |
Undocumented |
Instance Variable | proto |
Undocumented |
Instance Variable | stdin |
Undocumented |
Instance Variable | stdout |
Undocumented |
Inherited from _PollingTimer
:
Instance Variable | reactor |
Undocumented |
Method | _add |
Undocumented |
Method | _check |
Undocumented |
Method | _pause |
Undocumented |
Method | _poll |
Undocumented |
Method | _reschedule |
Undocumented |
Method | _start |
Undocumented |
Method | _stop |
Undocumented |
Method | _unpause |
Undocumented |
Instance Variable | _current |
Undocumented |
Instance Variable | _paused |
Undocumented |
Instance Variable | _poll |
Undocumented |
Instance Variable | _resources |
Undocumented |
Start talking to standard IO with the given protocol.
Also, put it stdin/stdout/stderr into binary mode.
Similar to getPeer, but returns an address describing this side of the connection.
Returns | |
An IAddress provider. |
Get the remote address of this connection.
Treat this method with caution. It is the unfortunate result of the CGI and Jabber standards, but should not be considered reliable for the usual host of reasons; port forwarding, proxying, firewalls, IP masquerading, etc.
Returns | |
An IAddress provider. |
Close my connection, after writing all pending data.
Note that if there is a registered producer on a transport it will not be closed until the producer has been unregistered.
Pause producing data.
Tells a producer that it has produced too much data to process for the time being, and to stop until resumeProducing() is called.
Register to receive data from a producer.
This sets self to be a consumer for a producer. When this object runs out of data (as when a send(2) call on a socket succeeds in moving the last data from a userspace buffer into a kernelspace buffer), it will ask the producer to resumeProducing().
For IPullProducer
providers, resumeProducing will be called once each time data is required.
For IPushProducer
providers, pauseProducing will be called whenever the write buffer fills up and resumeProducing will only be called when it empties. The consumer will only call resumeProducing to balance a previous pauseProducing call; the producer is assumed to start in an un-paused state.
Parameters | |
producer | Undocumented |
streaming | True if producer provides IPushProducer , False if producer provides IPullProducer . |
Raises | |
RuntimeError | If a producer is already registered. |
Resume producing data.
This tells a producer to re-add itself to the main loop and produce more data for its consumer.
Stop producing data.
This tells a producer that its consumer has died, so it must stop producing data for good.
Write some data to the physical connection, in sequence, in a non-blocking fashion.
If possible, make sure that it is all written. No data will ever be lost, although (obviously) the connection may be closed before it all gets through.
Parameters | |
data | The data to write. |