#NEWLINE# def get( self , version , * args , **kwargs ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . server . stats . connection_opened ( ) #NEWLINE# if ( version != '1' ) : #NEWLINE# #INDENT# raise HTTPError ( 503 , 'Invalid socket.io protocol version' ) #NEWLINE# #UNINDENT# sess = self . server . create_session ( self . request ) #NEWLINE# settings = self . server . settings #NEWLINE# data = ( '%s:%d:%d:%s' % ( sess . session_id , ( settings [ 'heartbeat_interval' ] + settings [ 'client_timeout' ] ) , ( settings [ 'xhr_polling_timeout' ] + settings [ 'client_timeout' ] ) , ',' . join ( ( t for t in self . server . settings . get ( 'enabled_protocols' ) ) ) ) ) #NEWLINE# if self . server . settings [ 'global_heartbeats' ] : #NEWLINE# #INDENT# sess . reset_heartbeat ( ) #NEWLINE# #UNINDENT# jsonp = self . get_argument ( 'jsonp' , None ) #NEWLINE# if ( jsonp is not None ) : #NEWLINE# #INDENT# self . set_header ( 'Content-Type' , 'application/javascript; charset=UTF-8' ) #NEWLINE# data = ( 'io.j[%s](%s);' % ( jsonp , proto . json_dumps ( data ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . set_header ( 'Content-Type' , 'text/plain; charset=UTF-8' ) #NEWLINE# #UNINDENT# self . preflight ( ) #NEWLINE# self . write ( t ) #NEWLINE# self . finish ( ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# self . server . stats . connection_closed ( )