#NEWLINE# def serve( self ) : #NEWLINE# #INDENT# self . socket . listen ( 0 ) #NEWLINE# while True : #NEWLINE# #INDENT# ( connection , address ) = self . socket . accept ( ) #NEWLINE# self . logger . info ( 'Connected by {0}' . format ( e ) ) #NEWLINE# connection = ssl . wrap_socket ( connection , keyfile = self . keyfile , certfile = self . certfile , server_side = True , cert_reqs = self . cert_reqs , ssl_version = self . ssl_version , ca_certs = self . ca_certs , do_handshake_on_connect = self . do_handshake_on_connect , suppress_ragged_eofs = self . suppress_ragged_eofs ) #NEWLINE# factory = KMIPProtocolFactory ( ) #NEWLINE# protocol = factory . getProtocol ( connection ) #NEWLINE# try : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# self . _processor . process ( protocol , protocol ) #NEWLINE# #UNINDENT# #UNINDENT# except EOFError as e : #NEWLINE# #INDENT# self . logger . warning ( 'KMIPServer {0} {1}' . format ( type ( e ) , e ) ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# self . logger . error ( 'KMIPServer {0} {1}' . format ( type ( e ) , e ) ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# connection . close ( ) #NEWLINE# self . logger . info ( 'Connection closed' )