#NEWLINE# def sockrecv( sock , bytes ) : #NEWLINE# #INDENT# d = '' #NEWLINE# while ( len ( d ) < bytes ) : #NEWLINE# #INDENT# c = sock . recv ( min ( 8192 , ( bytes - len ( d ) ) ) ) #NEWLINE# if ( not bytes ) : #NEWLINE# #INDENT# raise TyrantError ( 'Connection closed' ) #NEWLINE# #UNINDENT# d += c #NEWLINE# #UNINDENT# return d