def enter_event_loop(self):
patterns = self.dispatch_patterns()<EOL>self.logger.debug('<STR_LIT>')<EOL>while <NUM_LIT:1>:<EOL><INDENT>try:<EOL><INDENT>data = self._sock_file.readline()<EOL><DEDENT>except socket.error:<EOL><INDENT>data = None<EOL><DEDENT>if not data:<EOL><INDENT>self.logger.info('<STR_LIT>')<EOL>self.close()<EOL>return True<EOL><DEDENT>data = data.rstrip()<EOL>for pattern, callback in patterns:<EOL><INDENT>match = pattern.match(data)<EOL>if match:<EOL><INDENT>callback(**match.groupdict())<EOL><DEDENT><DEDENT><DEDENT>
\
        Main loop of the IRCConnection - reads from the socket and dispatches
        based on regex matching