<s> _GOODBYE_MESSAGE = u'<STR_LIT>' <EOL> def web_socket_do_extra_handshake ( request ) : <EOL> pass <EOL> def web_socket_transfer_data ( request ) : <EOL> while True : <EOL> line = request . ws_stream . receive_message ( ) <EOL> if line is None : <EOL> return <EOL> if isinstance ( line , unicode ) : <EOL> request . ws_stream . send_message ( line , binary = False ) <EOL> if line == _GOODBYE_MESSAGE : <EOL> return <EOL> else : <EOL> request . ws_stream . send_message ( line , binary = True ) </s>
