#NEWLINE# def _write( self ) : #NEWLINE# #INDENT# delay = 0.1 #NEWLINE# while self . _wb : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# sent = self . socket . send ( self . _wb ) #NEWLINE# if __debug__ : #NEWLINE# #INDENT# log . debug ( 'WROTE: %r' , self . _wb [ : sent ] ) #NEWLINE# #UNINDENT# self . _wb = self . _wb [ sent : ] #NEWLINE# #UNINDENT# except aio . SocketError as exc : #NEWLINE# #INDENT# if ( exc [ 0 ] == errno . EAGAIN ) : #NEWLINE# #INDENT# log . error ( 'SSL write fail, try again' ) #NEWLINE# time . sleep ( delay ) #NEWLINE# if ( delay < 2 ) : #NEWLINE# #INDENT# delay *= 2 #NEWLINE# #UNINDENT# continue #NEWLINE# #UNINDENT# if aio . would_block ( exc ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . close ( ) #NEWLINE# return False #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( not self . _wb ) and self . _write_callback ) : #NEWLINE# #INDENT# callback = self . _write_callback #NEWLINE# self . _write_callback = None #NEWLINE# callback ( ) #NEWLINE# #UNINDENT# return bool ( self . _wb )