<s> """<STR_LIT>""" <EOL> from twisted . internet import ssl <EOL> from twisted . internet . error import ConnectionClosed <EOL> from eventlet . twistedutil . protocol import GreenClientCreator <EOL> from eventlet . twistedutil . protocols . basic import LineOnlyReceiverTransport <EOL> from twisted . internet import reactor <EOL> conn = GreenClientCreator ( reactor ) . connectTCP ( '<STR_LIT>' , <NUM_LIT> ) <EOL> conn . write ( '<STR_LIT>' ) <EOL> conn . loseWriteConnection ( ) <EOL> print conn . read ( ) <EOL> conn = GreenClientCreator ( reactor , LineOnlyReceiverTransport ) . connectSSL ( '<STR_LIT>' , <NUM_LIT> , ssl . ClientContextFactory ( ) ) <EOL> conn . write ( '<STR_LIT>' ) <EOL> try : <EOL> for num , line in enumerate ( conn ) : <EOL> print '<STR_LIT>' % ( num , line ) <EOL> except ConnectionClosed , ex : <EOL> print ex </s>
