<s> from pynitro import NitroFrame <EOL> from diesel . protocols . nitro import DieselNitroSocket <EOL> from diesel import quickstart , quickstop <EOL> loc = "<STR_LIT>" <EOL> def server ( ) : <EOL> with DieselNitroSocket ( bind = loc ) as sock : <EOL> while True : <EOL> m = sock . recv ( ) <EOL> sock . send ( NitroFrame ( "<STR_LIT>" + m . data ) ) <EOL> def client ( ) : <EOL> with DieselNitroSocket ( connect = loc ) as sock : <EOL> for x in xrange ( <NUM_LIT> ) : <EOL> sock . send ( NitroFrame ( "<STR_LIT>" ) ) <EOL> m = sock . recv ( ) <EOL> assert m . data == "<STR_LIT>" <EOL> quickstop ( ) <EOL> quickstart ( server , client ) </s>
