def handle(self):
<EOL>try:<EOL><INDENT>while not self.server._shutdown_request_event.is_set():<EOL><INDENT>try:<EOL><INDENT>data = self.request.recv(<NUM_LIT>)<EOL>if not data:<EOL><INDENT>break<EOL><DEDENT>if self.debug:<EOL><INDENT>self.log.debug("<STR_LIT>" % data)<EOL><DEDENT>self.buffer.append(data)<EOL>for frame in self.buffer:<EOL><INDENT>self.log.debug("<STR_LIT>" % frame)<EOL>self.engine.process_frame(frame)<EOL>if not self.engine.connected:<EOL><INDENT>raise ClientDisconnected()<EOL><DEDENT><DEDENT><DEDENT>except socket.timeout:  <EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>except ClientDisconnected:<EOL><INDENT>self.log.debug("<STR_LIT>")<EOL><DEDENT>except Exception as e:  <EOL><INDENT>self.log.error("<STR_LIT>" % e)<EOL>self.engine.unbind()<EOL>raise<EOL><DEDENT>
Handle a new socket connection.