Files
deb-python-eventlet/examples/twisted_basic_client.py
Denis Bilenko 35d9abf786 changed BufferCreator arguments to match ClientCreator's (with protocol replaced by buffer);
moved binding of protocol,buffer and channel to BufferBase.build_protocol
2008-11-05 17:09:57 +06:00

11 lines
334 B
Python

from eventlet.twistedutil.protocol import BufferCreator
from eventlet.twistedutil.protocols.basic import LineOnlyReceiverBuffer
from twisted.internet import reactor
# read from TCP connection using default Buffer
conn = BufferCreator(reactor).connectTCP('www.google.com', 80)
conn.write('GET / HTTP/1.0\r\n\r\n')
print conn.read()