def setup(self):
log.debug( '<STR_LIT>',  self.client_address )<EOL>try:<EOL><INDENT>self.transport.load_server_moduli()<EOL><DEDENT>except:<EOL><INDENT>log.exception( '<STR_LIT>' )<EOL>raise<EOL><DEDENT>try:<EOL><INDENT>self.transport.add_server_key(self.host_key)<EOL><DEDENT>except:<EOL><INDENT>if self.host_key is None:<EOL><INDENT>log.critical('<STR_LIT>')<EOL>raise NotImplementedError('<STR_LIT>')<EOL><DEDENT><DEDENT>try:<EOL><INDENT>log.debug( '<STR_LIT>' )<EOL>self.transport.start_server(server=self)<EOL><DEDENT>except SSHException as e:<EOL><INDENT>log.warn('<STR_LIT>', e)<EOL>raise<EOL><DEDENT>while True:<EOL><INDENT>channel = self.transport.accept(<NUM_LIT:20>)<EOL>if channel is None:<EOL><INDENT>any_running = False<EOL>for c, thread in list(self.channels.items()):<EOL><INDENT>if thread.is_alive():<EOL><INDENT>any_running = True<EOL>break<EOL><DEDENT><DEDENT>if not any_running:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>log.info( '<STR_LIT>', channel )<EOL><DEDENT><DEDENT>
Setup the connection.