#NEWLINE# def recvd_CONNECTED( self , messageSubType , payload ) : #NEWLINE# #INDENT# '\n        Callback method for the connection confirmation handshake between\n        client and server.\n        ' #NEWLINE# if ( self . peerType == base . CLIENT ) : #NEWLINE# #INDENT# if ( self . state == base . STATE_CONNECTING ) : #NEWLINE# #INDENT# self . state = base . STATE_CONNECTED #NEWLINE# self . logger . info ( ( 'Connected to peer: %s' % self . sharingWithUser ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . logger . error ( ( 'Received CONNECTED message from server-peer when in state %s' % self . state ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . sendMessage ( base . CONNECTED ) #NEWLINE# self . state = base . STATE_CONNECTED #NEWLINE# self . logger . info ( ( 'Connected to peer: %s' % self . sharingWithUser ) ) #NEWLINE# self . notify ( collab_event . ESTABLISHED_SESSION , self )