#NEWLINE# def send_data( i , p ) : #NEWLINE# #INDENT# counter = 0 #NEWLINE# while ( counter < 100 ) : #NEWLINE# #INDENT# r = random . random ( ) #NEWLINE# if ( r < 0.4 ) : #NEWLINE# #INDENT# time . sleep ( r ) #NEWLINE# continue #NEWLINE# #UNINDENT# counter += 1 #NEWLINE# if ( r < 0.7 ) : #NEWLINE# #INDENT# p . validate_can_send_from_client ( 'blah blah blah' , '{0}:{1} client -> server' . format ( i , counter ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# p . validate_can_send_from_server ( 'blah blah blah' , '{0}:{1} server -> client' . format ( i , counter ) ) #NEWLINE# #UNINDENT# #UNINDENT# r = random . random ( ) #NEWLINE# if ( r < 0.5 ) : #NEWLINE# #INDENT# p . validate_closing_client_closes_server ( '{0} client close -> server close' . format ( i ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# p . validate_closing_server_closes_client ( '{0} server close -> client close' . format ( i ) )